On Sat, Jan 10, 2015 at 2:06 AM, Paul Rubin <no.email@nospam.invalid> wrote: > Chris Angelico <ros...@gmail.com> 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. ChrisA -- https://mail.python.org/mailman/listinfo/python-list