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 wh
Greg Ewing 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 there's not
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 "", line 1, in
> > TypeEr
Hi, Guido.
On Wed, May 19, 2010 at 12:11 AM, Guido van Rossum 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, not in a ra
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
2010/5/20 John Arbash Meinel :
> Giampaolo Rodolà wrote:
> class A:
>> ... def echo(self, x):
>> ... return x
>> ...
> a = A()
> a.echo()
>> Traceback (most recent call last):
>> File "", line 1, in
>> TypeError: echo() takes exactly 2 arguments (1 given)
>>
>> I bet
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 deve
On 20/05/2010 10:49, Giampaolo Rodolà wrote:
2010/5/20 John Arbash Meinel:
Giampaolo Rodolà wrote:
class A:
... def echo(self, x):
... return x
...
a = A()
a.echo()
Traceback (most recent call last):
File "", line 1, in
TypeErr
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
On Wed, May 19, 2010 at 1:56 AM, Gustavo Narea 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?=
wrote:
> 2010/5/20 John Arbash Meinel :
> > a.echo()
> >> Traceback (most recent call last):
> >> =A0 File "", line 1, in
> >> TypeError: echo() takes exactly 2 arguments (1 given)
> >>
> >> I bet my last 2 cents this ha
On 20/05/2010 17:02, geremy condra wrote:
On Wed, May 19, 2010 at 1:56 AM, Gustavo Narea wrote:
Hello, Oleg.
class UnorderedList(list):
def __eq__(self, other):
if not isinstance(other, UnorderedList):
return False
return sorted(self) == sorted(other)
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 should
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 meth
On Thu, May 20, 2010 at 09:18, Steven Bethard 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 documentation, 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 Na
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.
T
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 why
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
On Thu, May 20, 2010 at 5:59 PM, Gustavo Narea 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: http://www.python.org/ar/
__
On Tue, May 18, 2010 at 11:00 PM, Gustavo Narea 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
On Thu, May 20, 2010 at 10:18 PM, Mark Dickinson 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:
http://mail.python.o
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
On 5/20/2010 5:52 PM, Barry Warsaw wrote:
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
On May 20, 2010, at 06:01 PM, Terry Reedy wrote:
>On 5/20/2010 5:52 PM, Barry Warsaw wrote:
>> 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
>>>
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 secu
2010/5/20 Steven Bethard :
> 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 e
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 function
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 h
On 20May2010 17:46, Ben Finney 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 functions and foolishly
pri
Cameron Simpson writes:
> On 20May2010 17:46, Ben Finney 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 dic
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):
http://code.google.com/p/pythonfutures
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,
>
> 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 usi
37 matches
Mail list logo