Re: [Python-3000] Recursive str (was: Types and classes)

2008-04-11 Thread Oleg Broytmann
On Wed, Apr 09, 2008 at 09:20:56AM -0700, Guido van Rossum wrote: > We > already have repr() if you want unambiguous output; str() is for > pretty output. BTW, does Python 3000 fix the problem that str(container) calls repr() instead of str() for elements in the container? Oleg. -- Oleg

Re: [Python-3000] Recursive str (was: Types and classes)

2008-04-11 Thread Thomas Wouters
On Wed, Apr 9, 2008 at 6:30 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Wed, Apr 09, 2008 at 09:20:56AM -0700, Guido van Rossum wrote: > > We > > already have repr() if you want unambiguous output; str() is for > > pretty output. > > BTW, does Python 3000 fix the problem that str(containe

Re: [Python-3000] Recursive str

2008-04-11 Thread Oleg Broytmann
On Fri, Apr 11, 2008 at 02:44:34PM +0200, Thomas Wouters wrote: > On Wed, Apr 9, 2008 at 6:30 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > > > On Wed, Apr 09, 2008 at 09:20:56AM -0700, Guido van Rossum wrote: > > > We > > > already have repr() if you want unambiguous output; str() is for > > >

Re: [Python-3000] Recursive str

2008-04-11 Thread Guido van Rossum
On Fri, Apr 11, 2008 at 5:55 AM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: >str([a, b, c]) currently does a wrong thing if items are non-ascii > strings - calling repr() on them produces '\XXX' escapes instead of > a readable representation. But merely calling str() on the items instead of r

Re: [Python-3000] [Python-3000-checkins] r62269 - in python/branches/py3k: Lib/test/test_getargs2.py Objects/abstract.c Python/getargs.c

2008-04-11 Thread Guido van Rossum
I think you're right, the whole thing ought to be rolled back. The whole point of __index__ was that __int__ cannot be trusted not to truncate floats or float-like types. (Or do other conversions e.g. from string.) On Thu, Apr 10, 2008 at 5:53 PM, Trent Nelson <[EMAIL PROTECTED]> wrote: > > > Does

Re: [Python-3000] [Python-3000-checkins] r62269 - in python/branches/py3k: Lib/test/test_getargs2.py Objects/abstract.c Python/getargs.c

2008-04-11 Thread Thomas Wouters
On Fri, Apr 11, 2008 at 2:53 AM, Trent Nelson <[EMAIL PROTECTED]> wrote: > > > Does this mean that floats can now be used as list indexes? > > > Preventing this was the motivation for introducing the nb_index slot. > > > > > from http://www.python.org/dev/peps/pep-0357 :: > > > > > > The bigge

Re: [Python-3000] [Python-3000-checkins] r62269 - in python/branches/py3k: Lib/test/test_getargs2.py Objects/abstract.c Python/getargs.c

2008-04-11 Thread Trent Nelson
Agreed, in the middle of reverting the changes made in 62269 and 62279 now. I've also figured out why getargs_n() is broken for Windows x64 for negative values. I'll post a patch for review to python-3000@ shortly. From: [EMAIL PROTECTED] [mailto:[EM

[Python-3000] Phasing out % string formatting

2008-04-11 Thread Eric Smith
I've proposed on another thread the no new features are added to % formatting, specifically the PEP 3127 (Integer Literal Support and Syntax) '%b' formatting. It didn't generate any discussion, so I thought I'd bring it up in its own thread. I'd like to see us take the position that % formatti

Re: [Python-3000] Phasing out % string formatting

2008-04-11 Thread Brett Cannon
On Fri, Apr 11, 2008 at 3:21 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > I've proposed on another thread the no new features are added to % > formatting, specifically the PEP 3127 (Integer Literal Support and > Syntax) '%b' formatting. It didn't generate any discussion, so I > thought I'd bring

[Python-3000] getargs_n(), take two.

2008-04-11 Thread Trent Nelson
I reverted the changes from r62269 and r62279 in r62292. Any issues with the following patch? Note the removal of the guards around case 'n'; this will be the first time a lot of platforms will see this particular code path, as we're not falling back to 'l' anymore. Index: Python/getargs.c

Re: [Python-3000] Recursive str

2008-04-11 Thread Greg Ewing
Thomas Wouters wrote: > I don't see the value in str(['1', 1, '1, [1]', '1]', > '\n[1']) giving hard to understand output. Random data point: Being forced to do some Ruby programming recently, I found that Ruby does in fact produce just this sort of ambiguous output when you print a list, and it'

Re: [Python-3000] [Python-Dev] Need help for SWIG's Python 3.0 backend

2008-04-11 Thread Gregory P. Smith
-cc: python-dev +cc: python-3000 Hi Haoyu, I'm glad someone wanting to work on updating swig for python 3.x. A better mailing list for python 3.x internals questions as you work on this is the [email protected] list. The first place I suggest looking when you have a question is in the Pyth

Re: [Python-3000] Phasing out % string formatting

2008-04-11 Thread Alex Martelli
On Fri, Apr 11, 2008 at 4:05 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > On Fri, Apr 11, 2008 at 3:21 PM, Eric Smith > <[EMAIL PROTECTED]> wrote: > > I've proposed on another thread the no new features are added to % > > formatting, specifically the PEP 3127 (Integer Literal Support and > >