Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Daniel Stutzbach
On Feb 12, 2008 11:56 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Here's another way to look at it, maybe it'll help. My hunch is that > whenever someone writes x = copy(y), they actually know more about the > type of y than just that it is an object! Because if they knew > *nothing* about i

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Guido van Rossum
On Feb 12, 2008 3:11 PM, Daniel Stutzbach <[EMAIL PROTECTED]> wrote: > On Feb 12, 2008 4:52 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > > > > What useful information do we get by knowing that a type has a .copy() > > > method? > > > > It rules out all classes that don't have one. That's n

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Daniel Stutzbach
On Feb 12, 2008 4:52 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > What useful information do we get by knowing that a type has a .copy() > > method? > > It rules out all classes that don't have one. That's nearly all types. > Okay, but turn it around for a minute. Which types should have

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Greg Ewing
Guido van Rossum wrote: > I used Google Code Search to find examples of copy.copy(). > Many were hard to understand because there was no clue about the > argument passed it, and the copy() call doesn't help me infer its type > either. Contrast this with example code using iter() -- it tells me > th

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Greg Ewing
Guido van Rossum wrote: > Here's another way to look at it, maybe it'll help. My hunch is that > whenever someone writes x = copy(y), they actually know more about the > type of y than just that it is an object! I don't see how this is much different than the situation with __iter__. If you know

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Greg Ewing
Raymond Hettinger wrote: > The part I'm not following in this paragraph is how a d.copy() > method is any different from the d.__copy__() method that > is called by the copy() function. Both share the same underlying > implementation and both have the same effects when overridden. Having it a fun

Re: [Python-3000] Location of UserDict, UserList, and UserString

2008-02-12 Thread Steven Bethard
On Feb 11, 2008 9:10 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Was the concensus on this to move UserList into the collections module and to > remove UserString? > Any objections? No objections here either. Steve -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a

[Python-3000] Preventing merges into Py3k

2008-02-12 Thread Guido van Rossum
On Feb 12, 2008 9:44 AM, thomas.heller <[EMAIL PROTECTED]> wrote: > Author: thomas.heller > Date: Tue Feb 12 18:44:23 2008 > New Revision: 60746 > > Modified: >python/branches/py3k/Modules/_ctypes/_ctypes.c > Log: > Revert the last svnmerge (r60681) from trunk to _ctypes.c, it should > not have

Re: [Python-3000] ABC for Inequalities

2008-02-12 Thread Guido van Rossum
On Feb 11, 2008 10:40 PM, Neil Toronto <[EMAIL PROTECTED]> wrote: > The problem is that, like all the binary operators, "orderable" is only > defined for pairs of types. A single declaration of orderable-ness > necessarily lacks information needed for type safety. Actually, lots of languages have

Re: [Python-3000] ABC for Inequalities

2008-02-12 Thread Guido van Rossum
On Feb 11, 2008 10:38 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > That's a lot of firepower for such a little problem ;-) Indeed, which is why it was not adopted. ;-) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-30

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Guido van Rossum
On Feb 11, 2008 10:20 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > >> I don't think we'll ever get another chance to clean-up the mapping API > >> and to remove duplicate functionality (the code for > >> dict.__copy__ and dict.copy share the same implementation). > > > > I find the use of a

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Guido van Rossum
On Feb 12, 2008 2:40 PM, Daniel Stutzbach <[EMAIL PROTECTED]> > Based on the same reasoning, when we see x = copy(y) we can tentatively > assume that y is a type that can usefully be copied. Unless we don't trust > the author of the code to be sensible. My point is that (almost) any type is copya

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Guido van Rossum
On Feb 12, 2008 2:20 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > Here's another way to look at it, maybe it'll help. My hunch is that > > whenever someone writes x = copy(y), they actually know more about the > > type of y than just that it is an object! > > I don't se

Re: [Python-3000] Preventing merges into Py3k

2008-02-12 Thread Christian Heimes
Guido van Rossum wrote: > There is a way to prevent merging a particular revision by instructing > svnmerge properly. I believe the syntax is svnmerge block (svnmerge > help block will explain you more). > > Christian has been using this -- Christian, care to post a detailed example? Yes, svnmerg