Re: Storing empties

2005-11-08 Thread Jean-Paul Calderone
On Tue, 8 Nov 2005 19:28:36 -0800, Alex Martelli <[EMAIL PROTECTED]> wrote: >Aahz <[EMAIL PROTECTED]> wrote: > ... >> >For pickling, object() as a unique "nothing here, NOT EVEN a None" >> >marker (AKA sentinel) works fine. >> >> How does that work? Maybe I'm missing something obvious. >> >>

Re: Storing empties

2005-11-08 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: ... > >For pickling, object() as a unique "nothing here, NOT EVEN a None" > >marker (AKA sentinel) works fine. > > How does that work? Maybe I'm missing something obvious. > > sentinel = object() > class C: > def __init__(self, foo=sentinel): >

Re: Storing empties

2005-11-08 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Aahz <[EMAIL PROTECTED]> wrote: >>Alex: >>>Aahz: Alex: > >the canonical idiom when you need such distinction is: > >_not_there = object() What's your preferred idiom when you're dealing with stor

Re: Storing empties

2005-11-02 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: ... > >>>the canonical idiom when you need such distinction is: > >>> > >>>_not_there = object() ... > >> What's your preferred idiom when you're dealing with storable objects? > > > >What's a "storable object"? You mean, something that can be pickled, or > >p

Re: Storing empties

2005-11-01 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Aahz <[EMAIL PROTECTED]> wrote: >> In article <[EMAIL PROTECTED]>, >> Alex Martelli <[EMAIL PROTECTED]> wrote: >>> >>>the canonical idiom when you need such distinction is: >>> >>>_not_there = object() >>>def foo(bar=_not_the

Re: Storing empties

2005-10-31 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: > > > >the canonical idiom when you need such distinction is: > > > >_not_there = object() > >def foo(bar=_not_there, baz=_not_there, bap=_not_there): > >if bar is _not_there: ... > > >

Storing empties (was Re: Automatic binding of **kwargs to variables)

2005-10-31 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: > >the canonical idiom when you need such distinction is: > >_not_there = object() >def foo(bar=_not_there, baz=_not_there, bap=_not_there): >if bar is _not_there: ... > >Other unique objects can be substituted for the 'se