Re:Notset: A Do-Not-Care value for Python
by rdtsc on Saturday November 10, 2012 @07:45PM
(#4768308)
Why not just use Ellipsis? That is a good "not set value". It is unique so others' Ellipsis is also your Ellipsis. It is already there, don't need to import anything, do any git pull or such.
[ Parent
| on HN ]
Re:Notset: A Do-Not-Care value for Python
by shmeedogg on Saturday November 10, 2012 @08:02PM
(#4768349)
Interesting. I love the idea of not having to import an external library, but much like the `NotImplementedError` suggestion, it overloads a value that already has a specific meaning, in this case related to slice-notation.
I'd worry that this approach could end up being even more confusing.
Re:Notset: A Do-Not-Care value for Python
by rdtsc on Saturday November 10, 2012 @08:28PM
(#4768426)
Yeah it is a hack but in 6 or 7 years of using Python I haven't once needed to use Ellipsis for its intended purpose. I always end up using it though for "not set" where None is one of the valid set values.