Re: [Python-3000] UserDict revamp

2007-02-15 Thread Eduardo \"EdCrypt\" O. Padoan
Ops, sending to the whole list. On 2/15/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I tried to fix a few more unit tests tonight that had started failing > after the introduction of dict views. Looking over UserDict.py, it's > clear that this module needs more work -- while I banged it into

Re: [Python-3000] UserDict revamp

2007-02-15 Thread Steven Bethard
On 2/15/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Perhaps the most egregious example is MixinDict, which currently > assumes that keys() is a primitive operation returning a list, and > builds __iter__() out of that. Obviously a better approach is to turn > this around. (I'd have thought th

Re: [Python-3000] pre-PEP: Default Argument Expressions

2007-02-15 Thread Jim Jewett
On 2/13/07, Chris Rebert <[EMAIL PROTECTED]> wrote: > There are currently few, if any, known good uses of the current > behavior of mutable default arguments. Then are there *any* good use cases for the proposed semantics? Here are the use cases that I can remember seeing for mutable de

Re: [Python-3000] UserDict revamp

2007-02-15 Thread Guido van Rossum
On 2/15/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 2/15/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Perhaps the most egregious example is MixinDict, which currently > > assumes that keys() is a primitive operation returning a list, and > > builds __iter__() out of that. Obviously a

Re: [Python-3000] UserDict revamp

2007-02-15 Thread Raymond Hettinger
Since I contributed DictMixin and have been responsible for its maintenance, if no one minds, I would like to be the one to migrate it to Py3.0. Raymond - Original Message - From: "Guido van Rossum" <[EMAIL PROTECTED]> To: "Steven Bethard" <[EMAIL PROTECTED]> Cc: "Python 3000" ; "Eduar

Re: [Python-3000] pre-PEP: Default Argument Expressions

2007-02-15 Thread BJörn Lindqvist
On 2/15/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 2/13/07, Chris Rebert <[EMAIL PROTECTED]> wrote: > > There are currently few, if any, known good uses of the current > > behavior of mutable default arguments. > > Then are there *any* good use cases for the proposed semantics? Note

[Python-3000] Py3.0 Library Ideas

2007-02-15 Thread Raymond Hettinger
* Remove the unreliable empty() and full() methods from Queue.py * Remove jumpahead() from the random API. It is somewhat uncommon for PRNGs to have a closed form solution that jumpsahead N steps. * Make the primative for random be something generating random bytes rather than random floats.

Re: [Python-3000] pre-PEP: Default Argument Expressions

2007-02-15 Thread Chris Rebert
Okay, in light of Guido's comments, alternate idea: We require all default values to be hash()-able, thus reasonably ensuring their immutability. This doesn't deal with the 'x=None...' dance, but at least it might stop dangerous code from being written. Or if anyone else has ideas, that's great

Re: [Python-3000] pre-PEP: Default Argument Expressions

2007-02-15 Thread Brian Harring
On Thu, Feb 15, 2007 at 09:37:27PM -0800, Chris Rebert wrote: > Okay, in light of Guido's comments, alternate idea: > > We require all default values to be hash()-able, thus reasonably > ensuring their immutability. Offhand, that's a pretty arbitrary restriction- default __hash__ for objects is