The Python documentation should borrow the idea from the PHP.net

This seems to me to be a reason why an example would be useful: a code example is a great way to demonstrate that the function doesn’t take file names it takes file objects, and how you could create the needed file objects. We might disagree whether the function needs an example, but I can’t understand “it’s not possible to demonstrate it.” Of course it can be demonstrated. I think an example would be useful.

Examples don’t prevent people from practicing code themselves. Some here have said that users have to practice using the functions themselves. Of course. Then they seem to argue that means we don’t need examples. Examples are a good on-ramp to practicing by yourself.

You name this as something that doesn’t need an example. I don’t understand. Can you give an example of what you consider simple boolean functions? (See what I did there…?) Is any a simple boolean function? I think it could use examples.

I don’t understand if you are saying fmean should have examples, or should not? It looks like a useful example to me.

2 Likes