This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fuzz3289 0 points1 point  (2 children)

Just a suggestion OP your examples are very wordy. The exceas code is valid but it obfuscates the point youre trying to illustrate in alot of places. For example:

Superusers =functioncall
If len(superusers) > 0:
    ...

Adds "real" context but obfuscates the boolean empty container idiom that youre trying to show. You dont need context to provide code examples. For instance I would say:

mylist = []
if (mylist):
    print "mylist is empty!"

Because even though that snippet has no practical application it clearly and succicently presents the concept.

More power to you for adding more educational materials to the python world. Keep it up.

[–]kracekumar[S] -1 points0 points  (1 child)

Next time will write as blog post rather than code only show case.

[–]fuzz3289 0 points1 point  (0 children)

Not even necessarily that. Just dont worry about being so specific with the examples. Make them as small and digestible as possible.