Re: [Python-3000] struni and the Apple four-character-codes

2007-07-27 Thread Guido van Rossum
On 7/26/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > On 7/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > (Personally > > I'd like to use strings for the keys since {'TEXT': 'stuff'} is a lot > > clearer than {1413830740: 'stuff'} when encountered in a debugging > > session.) > > Good ar

Re: [Python-3000] struni and the Apple four-character-codes

2007-07-27 Thread Bob Ippolito
On 7/27/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 7/26/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > > On 7/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > (Personally > > > I'd like to use strings for the keys since {'TEXT': 'stuff'} is a lot > > > clearer than {1413830740:

Re: [Python-3000] pep 3124 plans

2007-07-27 Thread Guido van Rossum
On 7/26/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > On 7/23/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > For example, one pattern that sometimes comes up in writing methods > > is that you have a base class that always wants to do something > > *after* the subclass version of the method i

Re: [Python-3000] struni and the Apple four-character-codes

2007-07-27 Thread Guido van Rossum
On 7/27/07, Bob Ippolito <[EMAIL PROTECTED]> wrote: > 4CCs are not all ASCII, they're Mac OS Roman. This is why in some of > the C header files the constants turned into integers. Good to know! We should use that when converting them to Unicode. -- --Guido van Rossum (home page: http://www.pytho

[Python-3000] docstring for dict.values

2007-07-27 Thread Lisandro Dalcin
Why the docstrings for 'dict.values' says "a set-like object ..." ?? >>> list(dict(a=1,b=1,c=1).values()) [1, 1, 1] -- Lisandro DalcĂ­n ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe:

Re: [Python-3000] interaction between locals, builtins and except clause

2007-07-27 Thread Nick Coghlan
Lisandro Dalcin wrote: > I think it should work in any 2x and 3K. Is this right? Perhaps this > trick could be used for some automated conversion tool targeting > backward compatibility with 2.x series. The backwards compatible version looks like this: def __iter__(self): if self =

Re: [Python-3000] pep 3124 plans

2007-07-27 Thread Phillip J. Eby
At 08:25 AM 7/27/2007 -0700, Guido van Rossum wrote: >Basic GFs, great. Before/after/around, good. Other method >combinations, fine. But GFs in classes and subclassing? Not until we >have a much better design. Sounds reasonable to me. The only time I actually use them in classes myself is to ove

Re: [Python-3000] docstring for dict.values

2007-07-27 Thread Guido van Rossum
On 7/27/07, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > Why the docstrings for 'dict.values' says "a set-like object ..." ?? > > >>> list(dict(a=1,b=1,c=1).values()) > [1, 1, 1] Oops, that's a bug! Thanks for reporting. Committed revision 56584. -- --Guido van Rossum (home page: http://www.pyt

Re: [Python-3000] pep 3124 plans

2007-07-27 Thread Nick Coghlan
Phillip J. Eby wrote: > I don't know of any quick way to fix that, but I'll give it some thought. In the meantime, do we want the standard metaclass to complain when it finds generic functions in class bodies, or to automatically treat them as static methods? Cheers, Nick. -- Nick Coghlan

Re: [Python-3000] docstring for dict.values

2007-07-27 Thread Lisandro Dalcin
It seems the same applies to dict.items() ... $ set(dict(a=[]).items()) >>> set(dict(a=[]).items()) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' On 7/27/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 7/27/07, Lisandro Dalcin <[EMAIL PROTECTED

Re: [Python-3000] docstring for dict.values

2007-07-27 Thread Guido van Rossum
That's a totally different issue. The result of .items() is a set. But if it contains an unhashable object you can't convert it to a regular set. --Guido On 7/27/07, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > It seems the same applies to dict.items() ... > > $ set(dict(a=[]).items()) > >>> set(

Re: [Python-3000] struni and the Apple four-character-codes

2007-07-27 Thread Greg Ewing
Guido van Rossum wrote: > We could use Unicode strings where in the past we used 8-bit strings, > but that would be somewhat nasty when there's ever one of these codes > that's not pure ASCII Since this is a Mac-specific thing (and Classic-originated at that), I think you can be pretty sure that a

Re: [Python-3000] struni and the Apple four-character-codes

2007-07-27 Thread Greg Ewing
Ronald Oussoren wrote: > To reiterate: 4-character-codes in C are numeric literals I'm still not convinced about that. The major use of 4-char codes is in data structures stored on disk. I'd be surprised if they're really stored in the opposite order on little endian architectures, since then you