> 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
I noticed that UserString objects have methods that do not accept other
UserString objects as arguments:
>>> from UserString import UserString
>>> UserString('slartibartfast').count(UserString('a'))
Traceback (most recent call last):
File "", line 1, in -toplevel-
UserString('slartibartfas
> > > 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
Hello,
this time working up some of the patches with beards:
- #751943
Adds the display of the line number to cgitb stack traces even when
the source code is not available to cgitb. This makes sense in the
case that the source is lying around somewhere else. However, the
original patch g
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
On Sat, Feb 19, 2005, "Martin v. L?wis" wrote:
> Fredrik Lundh wrote:
>>
>>I'd say that this explains why it would still make sense to let the code
>>generator change
>>"x in (a, b, c)" to "x == a or x == b or x == c", as long as a, b, and c
>>are all integers.
>
> How often does that happen in
Raymond Hettinger wrote:
Hmm, what if you'd teach tuples to do faster contains lookups for
string or integer only content, e.g. by introducing sub-types for
string-only and integer-only tuples ?!
For a linear search, tuples are already pretty darned good and leave
room for only microscopic O(n) im
Donovan Baarda wrote:
Seriously, on the Python lists there has been a discussion rejecting an
md5sum implementation because the author "donated it to the public domain".
Apparently lawyers have decided that you can't give code away. Intellectual
charity is illegal :-)
Despite the smiley: It is not
Fredrik Lundh wrote:
I'd say that this explains why it would still make sense to let the code
generator change
"x in (a, b, c)" to "x == a or x == b or x == c", as long as a, b, and c are
all integers.
How often does that happen in real code?
Regards,
Martin
__
Donovan Baarda wrote:
> Apparently lawyers have decided that you can't give code away. Intellectual
> charity is illegal :-)
what else would a lawyer say? do you really expect lawyers to admit that there
are ways to do things that don't involve lawyers?
Tim Peters wrote:
> [Fredrik Lundh]
>> wouldn't be the first time...
>
> How soon we forget .
oh, that was in the dark ages of Python 1.4. I've rebooted myself many times
since
then...
> Fredrik introduced a pile of optimizations special-casing the snot out
> of small integers into ceval.c a l
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
16 matches
Mail list logo