Notset: A Do-Not-Care value for Python
github.com
Notset: A Do-Not-Care value for Python
1–10 of 41 posts
Re: Notset: A Do-Not-Care value for Python
#2Re: Notset: A Do-Not-Care value for Python
#3Sorry for the bikeshedding, but double negatives are a real pain. Not so much for the code itself, but for talking to colleagues and giving talks. Off the top of my head, Empty would could work.
Re: Notset: A Do-Not-Care value for Python
#4Sorry for the bikeshedding, but double negatives are a real pain. Not so much for the code itself, but for talking to colleagues and giving talks. Off the top of my head, Empty would could work.
I'd love an approach that used the standard library, but there doesn't seem to be a type-agnostic approach. float('nan') won't make sense for other types, and using `types.NoneType` instead of `None` seems even less understandable.
Re: Notset: A Do-Not-Care value for Python
#5Re: Notset: A Do-Not-Care value for Python
#6Sorry for the bikeshedding, but double negatives are a real pain. Not so much for the code itself, but for talking to colleagues and giving talks. Off the top of my head, Empty would could work.
Personally I would use "assigned" 1) to better reflect the meaning and 2) to follow PEP-8 and not use an uppercase.
Re: Notset: A Do-Not-Care value for Python
#7What's the difference to using "if name is not None:" in the first example?
Re: Notset: A Do-Not-Care value for Python
#8What's the difference to using "if name is not None:" in the first example?
Re: Notset: A Do-Not-Care value for Python
#9What's the difference to using "if name is not None:" in the first example?
That example could probably use some clarification, but the idea is that `name` and `age` in that example are both nullable, so passing in `None` (setting the column to NULL) is different than omitting the value (leaving the column unchanged).
Re: Notset: A Do-Not-Care value for Python
#10Sorry for the bikeshedding, but double negatives are a real pain. Not so much for the code itself, but for talking to colleagues and giving talks. Off the top of my head, Empty would could work.