[Python-3000] Removing functions from the operator module

2006-07-03 Thread Collin Winter
PEP 3100 mentions that isCallable() and sequenceIncludes() are to be removed from the operator module in Python 3000 because there are better, more obvious ways of spelling these things. So, on that note, should operator.truth() and operator.abs() be added to the to-be-removed list, in favour of t

Re: [Python-3000] replace globals() and global statement with global builtin object

2006-07-03 Thread BJörn Lindqvist
On 7/1/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 6/30/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > > BJörn Lindqvist wrote: > > > I have often wanted something similar to that for global > > > variables, instead of the global declaration: > > > > > > cache = None > > > def init(): > >

Re: [Python-3000] replace globals() and global statement with global builtin object

2006-07-03 Thread Guido van Rossum
On 7/3/06, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > On 7/1/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 6/30/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > > > BJörn Lindqvist wrote: > > > > I have often wanted something similar to that for global > > > > variables, instead of the gl

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Guido van Rossum
On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > PEP 3100 mentions that isCallable() and sequenceIncludes() are to be > removed from the operator module in Python 3000 because there are > better, more obvious ways of spelling these things. > > So, on that note, should operator.truth() and oper

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Collin Winter
On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > PEP 3100 mentions that isCallable() and sequenceIncludes() are to be > > removed from the operator module in Python 3000 because there are > > better, more obvious ways of spelling these

Re: [Python-3000] replace globals() and global statement with global builtin object

2006-07-03 Thread BJörn Lindqvist
> > cache = None > > def init(): > > if not cache: > > pass > > > > Throws a NameError because cache is not declared in function init's > > scope. So you would be forced to write: > > > > cache = None > > def init(): > > if not global.cache: > > global.cache = "foobar" > > >

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Guido van Rossum
+ On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > > PEP 3100 mentions that isCallable() and sequenceIncludes() are to be > > > removed from the operator module in Python 3000 be

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Michael Urman
On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > Stupid question: why? What's the better spelling of operator.add? > > + I reject your slippery slope argument that we'd have to remove operator.add. Not that we'd be able to tell, but +

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Collin Winter
On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > + But you can't pass a plus sign to higher-order functions. > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > > > P

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Guido van Rossum
On 7/3/06, Michael Urman <[EMAIL PROTECTED]> wrote: > On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > > Stupid question: why? What's the better spelling of operator.add? > > > > + > > I reject your slippery slope argument that we'd

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Collin Winter
On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 7/3/06, Michael Urman <[EMAIL PROTECTED]> wrote: > > On 7/3/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > > > Stupid question: why? What's the better spelling of operator.add?

Re: [Python-3000] replace globals() and global statement with global builtin object

2006-07-03 Thread Greg Ewing
BJörn Lindqvist wrote: > I think the fix for that is to remove the "scope inheritance." I.e: > > cache = None > def init(): > if not cache: > pass > > Throws a NameError because cache is not declared in function init's > scope. And do you want def f(): print "Eff!" def g

Re: [Python-3000] Removing functions from the operator module

2006-07-03 Thread Greg Ewing
Guido van Rossum wrote: > > On 7/3/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > > Stupid question: why? What's the better spelling of operator.add? > > + But that's not a function you can pass around, whereas bool and abs are. -- Greg ___ Python-3

Re: [Python-3000] xrange vs. int.__getslice__

2006-07-03 Thread Ivan Krstic
Vladimir 'Yu' Stepanov wrote: > - > for i in xrange(100): pass > vs. > for i in int[:100]: pass > - I'm a strong -1 on this; it makes it look like float[:100] should also be legal and reasonable