Comparisons and sorting of a numeric class....

Chris Angelico rosuav at
Fri Jan 9 16:14:58 CET 2015

On Sat, Jan 10, 2015 at 2:06 AM, Paul Rubin < at nospam.invalid> wrote:
> Chris Angelico <rosuav at> writes:
>> for instance, I might have a socket object, and I might not, so I can
>> use "if not self.socket: self.connect()" ...
> This sounds like you want a Maybe or Option object.

That's exactly what it is - a name that's always bound to either None
or a socket object. Since a socket object is always true, I can safely
use the above code.


More information about the Python-list mailing list