Re: [Python-Dev] Requesting that a class be a new-style class

2005-03-04 Thread Brett C.
Guido van Rossum wrote: This is something I've typed way too many times: Py> class C(): File "", line 1 class C(): ^ SyntaxError: invalid syntax It's the asymmetry with functions that gets to me - defining a function with no arguments still requires parentheses in the definition s

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-20 Thread Phillip J. Eby
At 09:15 AM 2/20/05 +0100, Alex Martelli wrote: This is because types.ClassType turns somersaults to enable this: in this latter construct, Python's mechanisms determine ClassType as the metaclass (it's the metaclass of the first base class), but then ClassType in turn sniffs around for another

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-20 Thread Michael Hudson
Alex Martelli <[EMAIL PROTECTED]> writes: > On 2005 Feb 20, at 04:35, Jack Diederich wrote: > >> I didn't dig into the C but does having 'type' >> as metaclass guarantee the same behavior as inheriting 'object' or >> does object >> provide something type doesn't? *wince* > > I believe the forme

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-20 Thread Alex Martelli
On 2005 Feb 20, at 04:35, Jack Diederich wrote: I always use new style classes so I only have to remember one set of behaviors. I agree: that's reason #1 I recommend always using new-style whenever I teach / tutor / mentor in Python nowadays. "__metaclass__ = type" is warty, it has the "action a

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Guido van Rossum
> I didn't dig into the C but does having 'type' > as metaclass guarantee the same behavior as inheriting 'object' or does object > provide something type doesn't? *wince* No, they're equivalent. __metaclass__ = type cause the base class to be object, and a base class of object causes the metacla

RE: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Raymond Hettinger
> > > This is something I've typed way too many times: > > > > > > Py> class C(): > > >File "", line 1 > > > class C(): > > > ^ > > > SyntaxError: invalid syntax > > > > > > It's the asymmetry with functions that gets to me - defining a > > > function with no arguments still r

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Jack Diederich
On Sun, Feb 20, 2005 at 12:13:25PM +1000, Nick Coghlan wrote: > Guido van Rossum wrote: > >>>This is something I've typed way too many times: > >>> > >>>Py> class C(): > >>> File "", line 1 > >>>class C(): > >>>^ > >>>SyntaxError: invalid syntax > >>> > >>>It's the asymmetry with f

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Nick Coghlan
Guido van Rossum wrote: This is something I've typed way too many times: Py> class C(): File "", line 1 class C(): ^ SyntaxError: invalid syntax It's the asymmetry with functions that gets to me - defining a function with no arguments still requires parentheses in the definition s

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Guido van Rossum
> > This is something I've typed way too many times: > > > > Py> class C(): > >File "", line 1 > > class C(): > > ^ > > SyntaxError: invalid syntax > > > > It's the asymmetry with functions that gets to me - defining a > > function with no arguments still requires parentheses

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Michael Hudson
Nick Coghlan <[EMAIL PROTECTED]> writes: > This is something I've typed way too many times: > > Py> class C(): >File "", line 1 > class C(): > ^ > SyntaxError: invalid syntax > > It's the asymmetry with functions that gets to me - defining a > function with no arguments still

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Michael Walter
But... only as an additional option, not as a replacement, right? Michael On Sat, 19 Feb 2005 03:01:14 -0500, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > This is something I've typed way too many times: > > > > > > Py> class C(): > > > File "", line 1 > > > class C(): > > >

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Raymond Hettinger
> > This is something I've typed way too many times: > > > > Py> class C(): > > File "", line 1 > > class C(): > > ^ > > SyntaxError: invalid syntax > > > > It's the asymmetry with functions that gets to me - defining a > > function with no arguments still requires parentheses in

Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-18 Thread Alex Martelli
On 2005 Feb 19, at 06:03, Nick Coghlan wrote: This is something I've typed way too many times: Py> class C(): File "", line 1 class C(): ^ SyntaxError: invalid syntax It's the asymmetry with functions that gets to me - defining a function with no arguments still requires parenthe

[Python-Dev] Requesting that a class be a new-style class

2005-02-18 Thread Nick Coghlan
This is something I've typed way too many times: Py> class C(): File "", line 1 class C(): ^ SyntaxError: invalid syntax It's the asymmetry with functions that gets to me - defining a function with no arguments still requires parentheses in the definition statement, but defining