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
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
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
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
> 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
> > > 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
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
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
> > 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
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
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():
> > >
> > 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
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
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
14 matches
Mail list logo