At Friday 27/10/2006 21:09, Ben Finney wrote:
> > >GLOBAL = object()
> > >
> > >def insert_ids(ids=GLOBAL):
> > >if ids is GLOBAL:
> > >ids = get_global_ids()
> >
> >The one disadvantage of this approach is that it complicates
> >pickling if/when you store the stentin
Gabriel Genellina <[EMAIL PROTECTED]> writes:
> At Friday 27/10/2006 11:40, Aahz wrote:
> > Ben Finney wrote:
> > >GLOBAL = object()
> > >
> > >def insert_ids(ids=GLOBAL):
> > >if ids is GLOBAL:
> > >ids = get_global_ids()
> >
> >The one disadvantage of this approach is
[EMAIL PROTECTED] (Aahz) writes:
> Ben Finney <[EMAIL PROTECTED]> wrote:
> >Use a unique do-nothing object, defined at the module level so
> >callers can easily get at it [...]
> >
> >GLOBAL = object()
> >
> >def insert_ids(ids=GLOBAL):
> >if ids is GLOBAL:
> >ids = ge
At Friday 27/10/2006 11:40, Aahz wrote:
>GLOBAL = object()
>
>def insert_ids(ids=GLOBAL):
>if ids is GLOBAL:
>ids = get_global_ids()
The one disadvantage of this approach is that it complicates pickling
if/when you store the stentinel in an instance. There are ways
In article <[EMAIL PROTECTED]>,
Ben Finney <[EMAIL PROTECTED]> wrote:
>
>Fourth, if you have decided that a magic sentinel value is called for
>but None is already taken for some other purpose, don't use a
>string. Use a unique do-nothing object, defined at the module level so
>callers can easily
"Paddy" <[EMAIL PROTECTED]> writes:
> None is what Python readers would expect as a sentinel value, but if
> any of your data fields could have None as a valid value then you may
> have to switch to a module level constant.
> Be wary of using sentinel values which are strings, if your data could
>
Ben Finney wrote:
> Howdy all,
>
> Ned Batchelder blogged[0] about a debate over checking function
> parameters, and to what extent dynamic typing should be relied upon.
>
> I was one of many who commented, but I wrote what purports to be a
> comprehensive checklist when considering special-case in
Howdy all,
Ned Batchelder blogged[0] about a debate over checking function
parameters, and to what extent dynamic typing should be relied upon.
I was one of many who commented, but I wrote what purports to be a
comprehensive checklist when considering special-case inputs for
functions. I thought