John Arbash Meinel wrote:
Because you wouldn't want to have
A.echo()
Say that it takes 1 argument and (-1 given) ?
Something like 1 argument in addition to 'self' would be
reasonably clear and would cover both situations.
+1 on fixing this from me, too. Even when you understand
exactly
Greg Ewing greg.ew...@canterbury.ac.nz writes:
John Arbash Meinel wrote:
Because you wouldn't want to have
A.echo()
Say that it takes 1 argument and (-1 given) ?
Something like 1 argument in addition to 'self' would be reasonably
clear and would cover both situations.
Except that
On Thu, May 20, 2010 at 11:55:02AM +0900, Stephen J. Turnbull wrote:
Giampaolo Rodolà writes:
class A:
... def echo(self, x):
... return x
...
a = A()
a.echo()
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: echo() takes
Hi, Guido.
On Wed, May 19, 2010 at 12:11 AM, Guido van Rossum gu...@python.org wrote:
This is typically called a bag. Maybe searching for that will help
you find a recipe?
A bag/multiset is close to what I need, except for one thing: I need to
iterate over the elements in the original order,
Hello, Oleg.
class UnorderedList(list):
def __eq__(self, other):
if not isinstance(other, UnorderedList):
return False
return sorted(self) == sorted(other)
def __ne__(self, other):
return not self.__eq__(other)
Do you need more than that?
Oleg.
2010/5/20 John Arbash Meinel john.arbash.mei...@gmail.com:
Giampaolo Rodolà wrote:
class A:
... def echo(self, x):
... return x
...
a = A()
a.echo()
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: echo() takes exactly 2 arguments (1 given)
On Wed, May 19, 2010 at 09:56:03AM +0100, Gustavo Narea wrote:
I think it'd be useful enough to go in the standard library. Now that
there's a sample implementation, should I still try to demonstrate why I
believe it's worth adding to the stdlib and get support?
I think yes. How many
On 20/05/2010 10:49, Giampaolo Rodolà wrote:
2010/5/20 John Arbash Meineljohn.arbash.mei...@gmail.com:
Giampaolo Rodolà wrote:
class A:
... def echo(self, x):
... return x
...
a = A()
a.echo()
Traceback (most recent call last):
On Thu, 20 May 2010 08:40:25 pm Oleg Broytman wrote:
On Wed, May 19, 2010 at 09:56:03AM +0100, Gustavo Narea wrote:
I think it'd be useful enough to go in the standard library. Now
that there's a sample implementation, should I still try to
demonstrate why I believe it's worth adding to the
On Wed, May 19, 2010 at 1:56 AM, Gustavo Narea m...@gustavonarea.net wrote:
Hello, Oleg.
class UnorderedList(list):
def __eq__(self, other):
if not isinstance(other, UnorderedList):
return False
return sorted(self) == sorted(other)
def __ne__(self, other):
On Thu, 20 May 2010 11:49:02 +0200, =?ISO-8859-1?Q?Giampaolo_Rodol=E0?=
g.rod...@gmail.com wrote:
2010/5/20 John Arbash Meinel john.arbash.mei...@gmail.com:
a.echo()
Traceback (most recent call last):
=A0 File stdin, line 1, in module
TypeError: echo() takes exactly 2 arguments (1 given)
On 20/05/2010 17:02, geremy condra wrote:
On Wed, May 19, 2010 at 1:56 AM, Gustavo Naream...@gustavonarea.net wrote:
Hello, Oleg.
class UnorderedList(list):
def __eq__(self, other):
if not isinstance(other, UnorderedList):
return False
return
Sorry I haven't had time to get around to the argparse issues. I
should have time this weekend. I need a release manager call on one of
the issues though. Two things I assume are fine to fix at this stage:
* In the documentation, the '--version' example should either not use
a shorthand, or
On 5/20/2010 4:02 AM, Floris Bruynooghe wrote:
TypeError: invoked as a method, echo() takes exactly 1 argument (0 given)
captures the semantics, but is perhaps too verbose.
How about:
TypeError: bound method echo() takes exactly 1 argument (0 given)
That way you can also have: unbound
On Thu, May 20, 2010 at 09:18, Steven Bethard steven.beth...@gmail.com wrote:
Sorry I haven't had time to get around to the argparse issues. I
should have time this weekend. I need a release manager call on one of
the issues though. Two things I assume are fine to fix at this stage:
* In the
Brett Cannon wrote:
In the end it's Benjamin's call, but my vote is to make the change.
The chances someone wanted None as their help message is so bloody
small and this is such a good UX change that I'm +1 on making the
change.
I completely agree.
--
Eric.
I think it'd be useful enough to go in the standard library. Now that
there's a sample implementation, should I still try to demonstrate why I
believe it's worth adding to the stdlib and get support?
Most definitely. Just in case it isn't clear: nobody else seems to think
this is useful (let
Martin said:
Most definitely. Just in case it isn't clear: nobody else seems to think
this is useful (let alone useful enough to go into the standard
library). In addition, it's trivial to implement, more reason not to add
it.
Yeah, fair enough. Thanks for your responses! :)
--
Gustavo Narea
Hello,
I would like to check that it's possible to a new C API function in the
2.6 branch, on the basis that it would help solve what seems to be
reported as a security problem by several vendors (including Linux
distributions) -- see http://bugs.python.org/issue5753 for a thorough
discussion.
Sounds good to me, since this is (a) a security fix that will make
some vendors happy, and (b) only a C-level API. I expect that some
apps embedding Python will use this API unconditionally and this break
with earlier Python versions; this could be intentional because of the
vulnerability (else
Anyone?
Gustavo said:
Hello, everyone.
I've checked the new collections.Counter class and I think I've found a bug:
from collections import Counter
c1 = Counter([1, 2, 1, 3, 2])
c2 = Counter([1, 1, 2, 2, 3])
c3 = Counter([1, 1, 2, 3])
c1 == c2 and c3 not in (c1, c2)
True
On Thu, May 20, 2010 at 5:59 PM, Gustavo Narea m...@gustavonarea.net wrote:
Anyone?
The best place to post a bug is the bug tracker [0]: you'll surely
receive proper attention there.
Regards,
[0] http://bugs.python.org/
--
.Facundo
Blog: http://www.taniquetil.com.ar/plog/
PyAr:
On Tue, May 18, 2010 at 11:00 PM, Gustavo Narea m...@gustavonarea.net wrote:
I've checked the new collections.Counter class and I think I've found a bug:
from collections import Counter
c1 = Counter([1, 2, 1, 3, 2])
c2 = Counter([1, 1, 2, 2, 3])
c3 = Counter([1, 1, 2, 3])
c1 == c2 and
On Thu, May 20, 2010 at 10:18 PM, Mark Dickinson dicki...@gmail.com wrote:
See also this recent thread on python-list, and in particular the messages
from Raymond Hettinger in that thread:
http://mail.python.org/pipermail/python-list/2010-March/thread.html
Sorry, bad thread link. Try:
On May 20, 2010, at 12:53 PM, Guido van Rossum wrote:
Sounds good to me, since this is (a) a security fix that will make
some vendors happy, and (b) only a C-level API. I expect that some
apps embedding Python will use this API unconditionally and this break
with earlier Python versions; this
Should we start thinking about releasing 2.6.6 soonish?
By tradition, it should come out soon after 2.7 and be the last bugfix
(except for security patches).
I guess what I mean is, should we have (at least) one more point release
before the post-2.7 last-bug-fix-release?
Because it's a
2010/5/20 Steven Bethard steven.beth...@gmail.com:
Sorry I haven't had time to get around to the argparse issues. I
should have time this weekend. I need a release manager call on one of
the issues though. Two things I assume are fine to fix at this stage:
* In the documentation, the
Ben Finney wrote:
Something like 1 argument in addition to 'self' would be reasonably
clear and would cover both situations.
Except that there's nothing special to the syntax or parser about the
name ‘self’.
That's true, but the use of the word 'self' here isn't meant
to refer to the name
Floris Bruynooghe wrote:
Not having looked at the code I don't know how hard it is for the code
that raises this traceback to notice if it's a bound or unbound method
tough.
The way things currently work, it would be quite difficult.
The exception is raised when attempting to call the
Giampaolo Rodolà wrote:
unbound method echo() must be called with A instance as first
argument (got nothing instead)
It talks about arguments while no arguments are actually involved in
the problem: just a class I forgot to initialize.
It's hard to see how this could be improved. If you had
On 20May2010 17:46, Ben Finney ben+pyt...@benfinney.id.au wrote:
| Would it help if the traceback showed the ‘repr()’ of each of the
| arguments received? That way it would be much clearer when the instance
| was received as the first argument.
I've occasionally passed large or deep dicts etc to
Cameron Simpson c...@zip.com.au writes:
On 20May2010 17:46, Ben Finney ben+pyt...@benfinney.id.au wrote:
| Would it help if the traceback showed the ‘repr()’ of each of the
| arguments received? That way it would be much clearer when the instance
| was received as the first argument.
I've
The PEP is here:
http://www.python.org/dev/peps/pep-3148/
I think the PEP is ready for pronouncement, and the code is pretty
much ready for submission into py3k (I will have to make some minor
changes in the patch like changing the copyright assignment):
On Fri, 21 May 2010 10:53:16 am Greg Ewing wrote:
Ben Finney wrote:
Something like 1 argument in addition to 'self' would be
reasonably clear and would cover both situations.
Except that there's nothing special to the syntax or parser about
the name ‘self’.
That's true, but the use of
This link has all post concatenated together in reverse order of how they
should be read. The tags link returns the same page. Does your blog software
allow you to make a master post and update with new links as available?
Ugh, either it doesn't or I couldn't find the feature (I'm using
35 matches
Mail list logo