B
Bryan
If you *get into the habit* of always checking with "if x is None:"
can you explain in more detail why "if x is None:" is better/faster than "if x == None:"? i guess i don't fully
understand "is". my fingers always seem to want to type "if not x:", but that is probably worse still since it includes
(), [], {}, '', False, None .
thanks,
bryan
rather than "if x == None:" -- two equally readable constructs -- it
will cost you no increase in effort whatsoever to always use the
idiom you've gotten used to. So, whether the (tiny) extra speed and
readability are important or not, it's still a good habit to pick up.
>
Alex
can you explain in more detail why "if x is None:" is better/faster than "if x == None:"? i guess i don't fully
understand "is". my fingers always seem to want to type "if not x:", but that is probably worse still since it includes
(), [], {}, '', False, None .
thanks,
bryan