[issue4090] Documenting set comparisons and operations

2008-11-15 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Attaching a proposed doc fix-up for this little can of worms (and for issue 4087). -- keywords: +patch Added file: http://bugs.python.org/file12018/expr.diff ___ Python tracker <[EMAIL PROTECTED

[issue4331] Can't use _functools.partial() created function as method

2008-11-15 Thread scott sadler
New submission from scott sadler <[EMAIL PROTECTED]>: Calling a function created by _functools.partial as a method raises an exception: "TypeError: method_new() takes exactly n non-keyword arguments (0 given)" Where method_new is the function passed into partial() and n is the number of argumen

[issue4309] ctypes documentation

2008-11-15 Thread David W. Lambert
David W. Lambert <[EMAIL PROTECTED]> added the comment: Conversely, if the documentation is correct then my ctypes is flawed. "None, integers, byte strings and unicode strings are the only native Python objects that can directly be used as parameters in these function calls. None is passed as

[issue4328] "à" in u"foo" raises a misleading error

2008-11-15 Thread Ezio Melotti
Ezio Melotti <[EMAIL PROTECTED]> added the comment: Usually, when you do operations involving unicode and normal strings, the latter are coerced to unicode using the default encoding. If the codec is not able to decode the string a UnicodeDecodeError is raised. E.g.: >>> 'à' + u'foo' Traceback (m

[issue4040] ignored exceptions in generators (regression?)

2008-11-15 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Well, I'll just cross my fingers then. :) -- resolution: -> wont fix status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4330] wsgiref.validate doesn't accept arguments to readline

2008-11-15 Thread Ian Bicking
Ian Bicking <[EMAIL PROTECTED]> added the comment: Yes, and I've wanted to deprecate paste.lint, but I can't because people use it over wsgiref.validate because it had this change applied. Yes, cgi.FieldStorage changed, but now that it's changed wsgiref needs to be compatible with it to be viabl

[issue4330] wsgiref.validate doesn't accept arguments to readline

2008-11-15 Thread Phillip J. Eby
Phillip J. Eby <[EMAIL PROTECTED]> added the comment: Uh, Ian, do you not remember being the person who *wrote* this code a few years ago? This is the old paste.lint with a little renaming. Of course it can be used with existing code -- code that complies with the WSGI spec. It's the cgi mo

[issue4330] wsgiref.validate doesn't accept arguments to readline

2008-11-15 Thread Ian Bicking
Ian Bicking <[EMAIL PROTECTED]> added the comment: This renders wsgiref.validate.validator completely useless, because it cannot be used with any existing code. ___ Python tracker <[EMAIL PROTECTED]> _

[issue4330] wsgiref.validate doesn't accept arguments to readline

2008-11-15 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-l

[issue4330] wsgiref.validate doesn't accept arguments to readline

2008-11-15 Thread Phillip J. Eby
Phillip J. Eby <[EMAIL PROTECTED]> added the comment: No, it shouldn't. The purpose of wsgiref.validate is to validate spec compliance, and the use of a readline() argument means that the program doing the invocation is not valid, per the spec. wsgiref.validate is correctly reporting the failur

[issue4330] wsgiref.validate doesn't accept arguments to readline

2008-11-15 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- assignee: -> pje nosy: +pje ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-

[issue4330] wsgiref.validate doesn't accept arguments to readline

2008-11-15 Thread Ian Bicking
New submission from Ian Bicking <[EMAIL PROTECTED]>: The method wsgiref.validate:InputWrapper.readline doesn't take any arguments. It should take an optional size argument. Though this isn't part of the WSGI specification, the cgi module uses this argument when parsing the body, and in practice

[issue4291] Allow Division of datetime.timedelta Objects

2008-11-15 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: @Christian Adding a __float__ method to datetime was entertained back in 2003, but was rejected. The same reasons apply to timedelta: """ - A C double doesn't have enough precision for roundtrip guarantees. - Does it really need to

[issue1726687] Bug found in datetime for Epoch time = -1

2008-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: on Windows (with Visual Studio), mktime() also sets tm_wday only if successful. But negative time_t are still not allowed by the Microsoft CRT, the tests fail. There are workaround to this - for example python could use techniques si

[issue2706] datetime: define division timedelta/timedelta

2008-11-15 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Sat, Nov 15, 2008 at 5:08 AM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > > Mark Dickinson <[EMAIL PROTECTED]> added the comment: > >> timedelta / should be disallowed in true division mode. > > I don't understand this; why should t

[issue887237] Machine integers

2008-11-15 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: I wonder if a patch for ctypes like this (which is not yet complete) could be used to implement this, or MUST it be implemented in C? The patch contains a mixin class that implements the numeric methods. However, the actual operation takes pl

[issue4328] "à" in u"foo" raises a misleading error

2008-11-15 Thread Matthew Barnett
Matthew Barnett <[EMAIL PROTECTED]> added the comment: The left operand is a bytestring and the right operand is a unicode string, so it makes sense that it raises an exception, although it would be clearer if it said "'in ' requires unicode string as left operand". I agree that if it's going to

[issue2666] webbrowser.py doesn't properly handle BROWSER env var

2008-11-15 Thread Oleg Broytmann
Changes by Oleg Broytmann <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10072/webbrowser.py.patch ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue2666] webbrowser.py doesn't properly handle BROWSER env var

2008-11-15 Thread Oleg Broytmann
Oleg Broytmann <[EMAIL PROTECTED]> added the comment: Update the patch. Added file: http://bugs.python.org/file12015/webbrowser.py.patch ___ Python tracker <[EMAIL PROTECTED]> ___

[issue2706] datetime: define division timedelta/timedelta

2008-11-15 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Some examples to help the choice (using the last patch). int --- 2L >>> print dt2 * 2 3:08:38 >>> print dt1 - dt2 * 2 0:51:22 >>> divmod(dt1, dt2) (2L, datetime.timedelta(0, 3082)) >>> print timedelta(0, 3082) 0:51:22 In 4 hours, you can wa

[issue2736] datetime needs and "epoch" method

2008-11-15 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Le Saturday 15 November 2008 04:17:50 Alexander Belopolsky, vous avez écrit : > it is really unnecessary because it can be > written as epoch + timedelta(0, seconds, microseconds). I tried yesterday and it doesn't work! datetime.datetime(197

[issue4329] base64 does not properly handle unicode strings

2008-11-15 Thread Michael Becker
New submission from Michael Becker <[EMAIL PROTECTED]>: See below. unicode string causes exception. Explicitly converting it to a regular string addresses the issue. I only noticed this because my input string changed to unicode after updating python to 2.6 and django to 1.0. >>> import base64 >

[issue4291] Allow Division of datetime.timedelta Objects

2008-11-15 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: [Christian] > float(td1) / float(td2) which is far more obvious than td1 / td2 To me, td1/td2 is more obvious that float(td1)/float(td2). float(td) involves an arbitrary choice, to return time in *seconds* (rather than days, or milliseconds

[issue2706] datetime: define division timedelta/timedelta

2008-11-15 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: By the way, I assume that any plan to add this division would also include adding the inverse operation: timedelta * float -> timedelta. It wouldn't make a whole lot of sense to have one without the other. _

[issue2706] datetime: define division timedelta/timedelta

2008-11-15 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: > timedelta / should be disallowed in true division mode. I don't understand this; why should the division mode affect division operations involving timedeltas at all? The meaning of "/" is unaffected by the division mode for float/float o

[issue4328] "à" in u"foo" raises a misleading error

2008-11-15 Thread Ezio Melotti
New submission from Ezio Melotti <[EMAIL PROTECTED]>: With Python 2.x: >>> 'à' in u'foo' Traceback (most recent call last): File "", line 1, in ? TypeError: 'in ' requires string as left operand >>> 'à' in u'xàx' Traceback (most recent call last): File "", line 1, in ? TypeError: 'in ' requir

[issue4324] locale documentation is inconsistent

2008-11-15 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Thanks, fixed in r67224. -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4312] Unicode in distutils meta-data?

2008-11-15 Thread Georg Brandl
Changes by Georg Brandl <[EMAIL PROTECTED]>: -- assignee: georg.brandl -> loewis nosy: +loewis ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4326] type of UserList instance returns class instead of instance

2008-11-15 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: What good is a comparison with InstanceType for? If you want to check whether it's an instance of a custom class, you'll have to check for instances of new-style classes anyway. If you want to check for UserList instances, use isinstance(). ---