[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 = 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 of working around that, but none are pleasant.
Hmm, and any other kind of serialisation would be similarly affected I suppose. What's an alternative? -- \ "Think for yourselves and let others enjoy the privilege to do | `\ so too." -- Voltaire, _Essay On Tolerance_ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list