Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Scott Dial
Steven D'Aprano wrote: It would be nice to be able to do this: defaults = dict(a=5, b=7) f(**defaults, a=8) # override the value of a in defaults I can't help but think that would be difficult coding convention to use. However, I'm considerably less bothered by: def f_with_defaults(**kw):

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Steven D'Aprano
On Sat, 28 Jun 2008 11:17:10 am Greg Ewing wrote: > tomer filiba wrote: > > >>> def f(**kwargs): > > > > ... print kwargs > > ... > > > > >>> f(a=5,b=7,a=8) > > > > {'a': 8, 'b': 7} > > I can't think of any reason why one would need to be > able to write such code, or even want to. It would

Re: [Python-Dev] urllib, multipart/form-data encoding and file uploads

2008-06-27 Thread Greg Ewing
Chris AtLee wrote: One thing I've always missed in urllib/urllib2 is the facility to encode POST data as multipart/form-data. I second that, having had to reinvent it a couple of times recently. It seems like an obvious thing to want to do, and it's surprising to find it's not supported. -- Gr

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Greg Ewing
tomer filiba wrote: >>> def f(**kwargs): ... print kwargs ... >>> f(a=5,b=7,a=8) {'a': 8, 'b': 7} >>> I can't think of any reason why one would need to be able to write such code, or even want to. -- Greg ___ Python-Dev mailing list Python-De

Re: [Python-Dev] urllib, multipart/form-data encoding and file uploads

2008-06-27 Thread Nick Coghlan
Chris AtLee wrote: Then we'd need to change either urllib or httplib to support iterable objects in addition to the regular strings that it currently uses. Chris, To avoid losing these ideas, could you add them to the issue tracker as feature requests? It's too late to get them into 2.6/3.0 b

Re: [Python-Dev] Community buildbots and Python release quality metrics

2008-06-27 Thread Nick Coghlan
Guido van Rossum wrote: On Thu, Jun 26, 2008 at 3:22 PM, Ralf Schmitt <[EMAIL PROTECTED]> wrote: On Thu, Jun 26, 2008 at 8:45 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: So you're saying py.test needs to be fixed? Fine with me, but then I don't understand why you bothered bringing it up her

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Jeff Hall
oops... baby jumped in my lap... i pretty much said it all though... I think the error of the software functioning incorrectly may necessitate the patch... I certainly understand Guido's concern, however. ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Jeff Hall
That's all fine and good but in this case there may be "stealth errors". If the user/programmer is expecting the first value to hold but instead On Fri, Jun 27, 2008 at 7:03 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Fri, Jun 27, 2008 at 2:54 PM, Fred Drake <[EMAIL PROTECTED]> wrote: >

Re: [Python-Dev] Disable tests in unittest (issue3202)

2008-06-27 Thread Jonathan Lange
On Fri, Jun 27, 2008 at 4:57 AM, Justin Mazzola Paluska <[EMAIL PROTECTED]> wrote: > I wasn't aware of bzrlib's extentions to unittest — many of them, > including KnownFailure, TestSkipped, > bzrlib.test.ExtendedTestResult.expectFailure, and the sundry list of > bzrlib.test.TestCase.assert* look u

Re: [Python-Dev] urllib, multipart/form-data encoding and file uploads

2008-06-27 Thread Bill Janssen
All sounds reasonable to me. Bill > On Fri, Jun 27, 2008 at 11:40 AM, Bill Janssen <[EMAIL PROTECTED]> wrote: > >> I notice that there is some work being done on urllib / urllib2 for > >> python 2.6/3.0. One thing I've always missed in urllib/urllib2 is the > >> facility to encode POST data as m

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Martin v. Löwis
> Now that I've learned about the hex float format supported by C++ and > Java, I wonder if it wouldn't be better to support conversion to and > from that format and nothing else. I would be fine with that, and prefer it over the original change. Regards, Martin __

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Guido van Rossum
On Fri, Jun 27, 2008 at 3:59 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > Mark Dickinson wrote: > >>> >> math.tohex(3.14) >>> >>> '0x1.91eb851eb851fp+1' >> >> math.fromhex('0x1.91eb851eb851fp+1') >>> >>> 3.1401 > > How about just one self-inverse method .hex? > .hex(floa

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Guido van Rossum
On Fri, Jun 27, 2008 at 2:54 PM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Fri, Jun 27, 2008 at 8:02 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> Now that I've learned about the hex float format supported by C++ and >> Java, I wonder if it wouldn't be better to support conversion to and

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Guido van Rossum
On Fri, Jun 27, 2008 at 2:54 PM, Fred Drake <[EMAIL PROTECTED]> wrote: > On Jun 27, 2008, at 5:23 PM, Benjamin Peterson wrote: >> >> I think code that uses this is probably already quite broken in some >> fundamental way and putting the fix in 2.5 isn't much of a risk. > > I suspect the risk has mo

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Terry Reedy
Mark Dickinson wrote: math.tohex(3.14) '0x1.91eb851eb851fp+1' math.fromhex('0x1.91eb851eb851fp+1') 3.1401 How about just one self-inverse method .hex? .hex(float/hexstring) returns corresponding hexstring/float ___ Python-Dev mail

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Guido van Rossum
Yes. On Fri, Jun 27, 2008 at 2:18 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > So we wait until they port their code to 2.6 to break it? > > regards > Steve > > Guido van Rossum wrote: >> >> Sounds like a regression in 2.5 (and in 2.6, and in 3.0). Probably due >> to the switch to the new AST-b

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Guido van Rossum
On Fri, Jun 27, 2008 at 2:23 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > On Fri, Jun 27, 2008 at 2:11 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> Sounds like a regression in 2.5 (and in 2.6, and in 3.0). Probably due >> to the switch to the new AST-based compiler. Can you file a bug?

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Mark Dickinson
On Fri, Jun 27, 2008 at 8:02 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Now that I've learned about the hex float format supported by C++ and > Java, I wonder if it wouldn't be better to support conversion to and > from that format and nothing else. By the way, this particular format is als

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Benjamin Peterson
On Fri, Jun 27, 2008 at 5:00 PM, Scott Dial <[EMAIL PROTECTED]> wrote: > > The old compiler checked for this, but the AST-based compiler just blindly > compiles the entire keyword argument sequence. The new compiler will check for it when my patch on the issue 3219 is applied. -- Cheers, Benjam

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Scott Dial
Scott Dial wrote: The regression is purely in the way an argument list is reduced to a dictionary. To further elaborate: Python 2.4: >>> import dis >>> dis.dis(compile('f(a=3, b=1, a=4)', '', 'eval')) Traceback (most recent call last): File "", line 1, in ? SyntaxError: duplicate keyword arg

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Mark Dickinson
On Fri, Jun 27, 2008 at 8:02 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Now that I've learned about the hex float format supported by C++ and > Java, I wonder if it wouldn't be better to support conversion to and > from that format and nothing else. > > E.g. > math.tohex(3.14) > '0x1.91

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Fred Drake
On Jun 27, 2008, at 5:23 PM, Benjamin Peterson wrote: I think code that uses this is probably already quite broken in some fundamental way and putting the fix in 2.5 isn't much of a risk. I suspect the risk has more to do with breaking something else in Python than in breaking 3rd-party code

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Scott Dial
David Wolever wrote: I don't have 2.4 handy to test it, but it is more likely that a keyword and dictionary are passed, both containing the same item: >>> f(a=3, **{'a': 4}) Would that be a potential risk? Python 2.4.3 >>> f(a=3, **{'a': 4}) Traceback (most recent call last): File "", line

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread David Wolever
On 27-Jun-08, at 6:23 PM, Benjamin Peterson wrote: On Fri, Jun 27, 2008 at 2:11 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: Sounds like a regression in 2.5 (and in 2.6, and in 3.0). Probably due to the switch to the new AST-based compiler. Can you file a bug? I think we should leave 2.5

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Benjamin Peterson
On Fri, Jun 27, 2008 at 2:11 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Sounds like a regression in 2.5 (and in 2.6, and in 3.0). Probably due > to the switch to the new AST-based compiler. Can you file a bug? I > think we should leave 2.5 alone (too much risk of breaking code) but > fix it

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Steve Holden
So we wait until they port their code to 2.6 to break it? regards Steve Guido van Rossum wrote: Sounds like a regression in 2.5 (and in 2.6, and in 3.0). Probably due to the switch to the new AST-based compiler. Can you file a bug? I think we should leave 2.5 alone (too much risk of breaking

Re: [Python-Dev] urllib, multipart/form-data encoding and file uploads

2008-06-27 Thread Chris AtLee
On Fri, Jun 27, 2008 at 11:40 AM, Bill Janssen <[EMAIL PROTECTED]> wrote: >> I notice that there is some work being done on urllib / urllib2 for >> python 2.6/3.0. One thing I've always missed in urllib/urllib2 is the >> facility to encode POST data as multipart/form-data. I think it would >> als

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Guido van Rossum
Sounds like a regression in 2.5 (and in 2.6, and in 3.0). Probably due to the switch to the new AST-based compiler. Can you file a bug? I think we should leave 2.5 alone (too much risk of breaking code) but fix it in 2.6 and 3.0 if we can. --Guido On Fri, Jun 27, 2008 at 12:07 PM, tomer filiba <

[Python-Dev] repeated keyword arguments

2008-06-27 Thread tomer filiba
the following code works on python 2.5: >>> def f(**kwargs): ... print kwargs ... >>> f(a=5,b=7,a=8) {'a': 8, 'b': 7} >>> but fails on python2.4, saying that "a" is given twice. is this a bug or a feature? -tomer ___ Python-Dev mailing list Python

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Guido van Rossum
PS. I can't get excited about having support for this in %-style format strings (and even less so now %a already means "call ascii()"). It would be easy enough to add support for it to float.__format__() though. On Fri, Jun 27, 2008 at 12:02 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Now th

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-27 Thread Guido van Rossum
Now that I've learned about the hex float format supported by C++ and Java, I wonder if it wouldn't be better to support conversion to and from that format and nothing else. E.g. >>> math.tohex(3.14) '0x1.91eb851eb851fp+1' >>> math.fromhex('0x1.91eb851eb851fp+1') 3.1401 >>> BTW I am

Re: [Python-Dev] Community buildbots and Python release quality metrics

2008-06-27 Thread Guido van Rossum
On Thu, Jun 26, 2008 at 5:33 PM, <[EMAIL PROTECTED]> wrote: > OK, fair enough. Taking a step back, I was pushing this really hard because > to *me*, it seems like dealing with the influx of bug reports after the fact > is an unreasonable amount of additional work, whereas immediate reverts are >

Re: [Python-Dev] Community buildbots and Python release quality metrics

2008-06-27 Thread Guido van Rossum
On Thu, Jun 26, 2008 at 3:22 PM, Ralf Schmitt <[EMAIL PROTECTED]> wrote: > On Thu, Jun 26, 2008 at 8:45 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> >> So you're saying py.test needs to be fixed? Fine with me, but then I >> don't understand why you bothered bringing it up here instead of >> f

[Python-Dev] Summary of Python tracker Issues

2008-06-27 Thread Python tracker
ACTIVITY SUMMARY (06/20/08 - 06/27/08) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue number. Do NOT respond to this message. 1933 open (+40) / 13106 closed (+25) / 15039 total (+65) Open issues with patches: 600 Average

Re: [Python-Dev] urllib, multipart/form-data encoding and file uploads

2008-06-27 Thread Bill Janssen
> I notice that there is some work being done on urllib / urllib2 for > python 2.6/3.0. One thing I've always missed in urllib/urllib2 is the > facility to encode POST data as multipart/form-data. I think it would > also be useful to be able to stream a POST request to the remote > server rather

[Python-Dev] urllib, multipart/form-data encoding and file uploads

2008-06-27 Thread Chris AtLee
Hello, I notice that there is some work being done on urllib / urllib2 for python 2.6/3.0. One thing I've always missed in urllib/urllib2 is the facility to encode POST data as multipart/form-data. I think it would also be useful to be able to stream a POST request to the remote server rather th

[Python-Dev] Vacation

2008-06-27 Thread Thomas Heller
FYI: I'm going to a vacation for the next two or three weeks. I will shutdown my buildbots, and restart them when I'm back: x86 osx.5, x86 XP-3, amd64 XP. Sorry for the inconvenience, Thomas ___ Python-Dev mailing list Python-Dev@python.org http://mail

Re: [Python-Dev] deepcopy

2008-06-27 Thread Amaury Forgeot d'Arc
Walter Bender wrote: Hello togehter, > > I get an error while doing a deep copy of an "event". An event is an object, > with has a lot of __dict__["attr"] = Event("SAMPLE") OTHER Events added to > the object (no self refence) and store additional __dict__["attr2"] = 2 > informations. > > deep cop

Re: [Python-Dev] Community buildbots and Python release quality metrics

2008-06-27 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: I do tend to ramble on, so here's an executive summary of my response: I want python developers to pay attention to the community buildbots and to treat breakages of existing projects as a serious issue. Counter-proposal: * Interested developers or users of the majo

Re: [Python-Dev] Undocumenting test.support in 3.x (was Py3k DeprecationWarning in stdlib)

2008-06-27 Thread Nick Coghlan
Benjamin Peterson wrote: On Thu, Jun 26, 2008 at 10:34 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: On Thu, Jun 26, 2008 at 8:32 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: I'm personally fine with that approach, but some of the new items in there for 2.6 could probably use a bit of cleaning

[Python-Dev] deepcopy

2008-06-27 Thread Walter Bender
Hello togehter, I get an error while doing a deep copy of an "event". An event is an object, with has a lot of __dict__["attr"] = Event("SAMPLE") OTHER Events added to the object (no self refence) and store additional __dict__["attr2"] = 2 informations. deep c