I have a question about , code readability, and . I'm planning to do a blog post about this, but I would like to have some numbers about the community (and comments if you have some).

If you have a Twitter account, I would appreciate if you could vote there. twitter.com/X_Cli_Public/statu

I wish Mastodon had the poll feature so I could create it here instead.

Of course, if you don't care about poll anonymity, you can vote by answering to this toot :) I'll do the math x)

Follow

@x_cli 'if value:' is the python way :) You really don't want to compare to "", if it's set to None hilarity will ensue.

@bcl By hilarity, do you mean that the behaviour is erratic depending on the Python version?

Interestingly, you caught that the edge case was None and you chose "if value:" because of it. My personnal choice is "if value != ''" and of course, that's why I initiated the poll :)

@x_cli By hilarity I mean users learning what "NoneType has no attribute foo" means when they run the program with unexpected input. One of my primary complaints about is the lack of sane defaults for values.

Sign in to participate in the conversation
Infosec Exchange

A Mastodon instance for info/cyber security-minded people.