[issue215555] Parser crashes for deeply nested list displays

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: Fine, submit a patch. Might as well open a new bug for the patch (referring to this one for background). Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/is

[issue1621] Do not assume signed integer overflow behavior

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: The proper thing to do here is to add -Werror=strict-overflow to the CFLAGS (*before* -Wall -- we should fix the position of -Wall!); this will turn all those spots into errors, forcing us to fix them, and alerting users who might be using a newer compiler

[issue1865] Bytes alias for 2.6

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like you forgot tokenize.py Make sure none of this gets merged into 3.0! -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue1621] Do not assume signed integer overflow behavior

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: Would you mind also adding patches for the places you think you can fix, and providing us with a list of places you need help with? O'm hoping that Greg or Christian can help reviewing these and committing them. Thanks much for your hel

[issue1621] Do not assume signed integer overflow behavior

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: Close, I'd like to keep the -fwrapv if -Wstrict-overflow isn't supported. Also, would checking this in mean we can't build with GCC 4.3 until those issues are all fixed? __ Tracker <[EMAIL PROTECTED]> &l

[issue1866] const arg for PyInt_FromString

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: So how about submitting a patch *and* building everything from scratch and running all the unit tests to make sure this doesn't break anything? -- nosy: +gvanrossum priority: -> low __ Tracker <[EMAI

[issue1621] Do not assume signed integer overflow behavior

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! Good catch about -Wall. I think I am now able to reproduce these results with gcc 4.2. These results, while much more disturbing regarding the state of our code base, at least restore my faith in GCC. :-) __ Tracker

[issue1621] Do not assume signed integer overflow behavior

2008-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: An unsigned variant of Py_ssize_t would just be size_t -- that's a much older type than ssize_t. I don't think we need to invent a Py_ name for it. __ Tracker <[EMAIL PROTECTED]> <http://bugs.p

[issue1657] [patch] epoll and kqueue wrappers for the select module

2008-01-19 Thread Guido van Rossum
Guido van Rossum added the comment: Still haven't had the time (sorry!), but one comment: please don't specify timeouts in millisecond. We use seconds (floats if necessary) everywhere else in Python, regardless of the underlying data structure or

[issue1640] Enhancements for mathmodule

2008-01-21 Thread Guido van Rossum
Changes by Guido van Rossum: -- nosy: -gvanrossum __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1640> __ ___ Python-bugs-list mailing list Unsubs

[issue1881] increase parser stack limit

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: I don't know what common stack sizes are any more. Even on the same platform, the main thread may have a different stack size than other threads. Would it make sense to make this limit more platform-dependent? I guess really good would be a way to h

[issue614557] LookupError etc. need API to get the key

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: I think it would be a good idea to revisit this for py3k, but I'm out of round tuits. Anyone else want to tackle this? It should ideally be done in such a way that non-core object types can also easily raise these exceptions with the appropriate attri

[issue1473257] Add a gi_code attr to generators

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: I noticed some whitespace issues in the patch, but apart from that I have no objection. (Not any particular enthusiasm, I have to admit -- I don't quite get the use case, but as Georg remarks, it seems harmless.) _ Tr

[issue1336] subprocess.Popen hangs when child writes to stderr

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Was this a security fix? We aren't supposed to backport non-security fixes to 2.4, and Martin is actually planning to *reverse* the non-security patches applied to 2.4 since 2.4.4 was released, to make it easier to release a "pure security&qu

[issue1124] Webchecker not parsing css "@import url"

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: If someone is still interested in webchecker, they should start a fork. Let's remove it from 3.0. At this point it's so old, it's probably dangerous. -- resolution: -> wont fix status: open -> closed _

[issue1336] subprocess.Popen hangs when child writes to stderr

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Martin can do it all in one fell sweep. -- nosy: +loewis __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1336> __ ___

[issue1888] strange 'global'

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: This isn't going to change. 'global' is one of those rare pieces of syntax that are not executed by the interpreter but detected by the parser. Note that there are other things like this, e.g. the presence of 'yield' in a function ma

[issue1889] string literal documentation differs from implementation

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Your example does not use a "raw" string -- a raw string has an 'r' in front of the opening string quotes. Try this instead: >>> s = r"""a\ ... b""" >>> s 'a\\\nb' Your second is

[issue1904] Add key argument to heapq functions

2008-01-22 Thread Guido van Rossum
Changes by Guido van Rossum: -- assignee: -> rhettinger keywords: +patch nosy: +rhettinger priority: -> low __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue1577] shutil.move() does not use os.rename() if dst is a directory

2008-01-22 Thread Guido van Rossum
Guido van Rossum added the comment: Antoine: please just ignore me, even though I may once have written this code, I clearly don't understand it any more. :-) All we need now is a patch and someone to review it, right? __ Tracker <[EMAIL PROTECTED

[issue1651] Limit the max size of PyUnicodeObject->defenc?

2008-01-22 Thread Guido van Rossum
Guido van Rossum added the comment: > * choose not to care, as the conversion looks rather rare Yes. > * incref the return value of _PyUnicode_AsDefaultEncodedString(), > and convert the 20 or so places in which that function is used to > properly decref the value when done N

[issue1651] Limit the max size of PyUnicodeObject->defenc?

2008-01-22 Thread Guido van Rossum
Guido van Rossum added the comment: You wish. In practice (unfortunately) it's still used quite a bit. It would be a good project to eradicate the need, but I see it as low priority. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python

[issue1911] webbrowser.open firefox 3 issues

2008-01-22 Thread Guido van Rossum
Guido van Rossum added the comment: What platform? How come? Got a fix that doesn't break for other browsers? There's a 1-2 week window at most for getting fixes into 2.5.2! -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> <htt

[issue1911] webbrowser.open firefox 3 issues

2008-01-22 Thread Guido van Rossum
Guido van Rossum added the comment: OK, since it's so simple I'll take it if noone else does. But anyone else who feels like backporting this please go ahead! -- assignee: -> gvanrossum keywords: +easy, patch priority: -> high __

[issue1819] Speed hack for function calls with named parameters

2008-01-22 Thread Guido van Rossum
Guido van Rossum added the comment: Nice idea, but why set the priority to high? I have no immediate time to review this and probably won't for a while. -- priority: high -> normal __ Tracker <[EMAIL PROTECTED]> <http://bugs.pyt

[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: Reopening, since test67.py still causes a segfault in the trunk. It is represented as Lib/test/crashers/loosing_dict_ref.py [sic]. -- nosy: +gvanrossum priority: normal -> urgent status: closed -> open _ T

[issue1918] weak references are removed before __del__ is called.

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: Georg, can you update the docs? Weak references *to* an object are cleared before the object's __del__ is called, to ensure that the weak reference callback (if any) finds the object healthy. -- assignee: -> georg.brandl nosy: +geor

[issue1577] shutil.move() does not use os.rename() if dst is a directory

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: > Before tackling this, I'd like a precision on os.rename(src, dst) > semantics. The documentation says "If dst is a directory, OSError will > be raised". However, under Linux, if src is a directory and dst is an > empty directory,

[issue1917] init_types() in Parser/asdl_c.py conflicts with init_types() in Modules/_typesmodule.c

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: The comment in config.c is wrong. If you still have a Python/_typesmodule.c file, something's wrong on your end! -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> <http://bugs.python

[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: Armin, what do you think of the attached patch (deldict.diff)? Added file: http://bugs.python.org/file9274/deldict.diff _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/iss

[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: Here's a better fix, which also fixes the similar code path in GenericSetAttr(). As a bonus, I reviewed all uses of _PyObject_GetDictPtr() and found one questionable place where the dict at *dictptr was DECREF'ed before that location was set to NULL

[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Guido van Rossum
Changes by Guido van Rossum: Added file: http://bugs.python.org/file9275/deldict.diff _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1303614> _ ___ Pyth

[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Guido van Rossum
Changes by Guido van Rossum: Removed file: http://bugs.python.org/file9274/deldict.diff _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1303614> _ ___ Pyth

[issue1303614] Bypassing __dict__ readonlyness

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: The more i think about it, I don't think the issue in typeobject.c can ever occur, so I'm skipping that part of the fix. _ Tracker <[EMAIL PROTECTED]> <http://bugs.pyth

[issue1303614] Bypassing __dict__ readonlyness

2008-01-24 Thread Guido van Rossum
Guido van Rossum added the comment: On Jan 23, 2008 11:12 PM, Neal Norwitz <[EMAIL PROTECTED]> wrote: > > Neal Norwitz added the comment: > > I looked at Guido's latest deldict.diff patch--the one to > Objects/object.c only. It seems good. I can't convince mysel

[issue1919] Backport of io.py

2008-01-24 Thread Guido van Rossum
Guido van Rossum added the comment: Backporting bytearray should be relatively clean since it's a brand new type right? -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> <http://bugs.python

[issue1925] TypeError in deepcopy

2008-01-24 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, we're not able to help with SWIG errors in this bug tracker. -- nosy: +gvanrossum resolution: -> rejected status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.

[issue1303614] Bypassing __dict__ readonlyness

2008-01-24 Thread Guido van Rossum
Guido van Rossum added the comment: r60247 (2.5.2 branch), r60246 (2.6 trunk). -- resolution: -> fixed status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1377858] segfaults when using __del__ and weakrefs

2008-01-24 Thread Guido van Rossum
Guido van Rossum added the comment: This got fixed for classic classes in r60057, and backported to 2.5.2 in 60056. -- nosy: +gvanrossum _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/iss

[issue1928] test_urllib fails

2008-01-24 Thread Guido van Rossum
New submission from Guido van Rossum: FAIL: test_read (__main__.urlopen_HttpTests) -- Traceback (most recent call last): File "Lib/test/test_urllib.py", line 130, in test_read self.assertEqual(fp.getc

[issue1930] sys.maxint not found in Python 3.0a2

2008-01-24 Thread Guido van Rossum
Changes by Guido van Rossum: -- components: +Documentation __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1930> __ ___ Python-bugs-list mailing list

[issue1931] NameError: global name 'basestring' is not defined

2008-01-24 Thread Guido van Rossum
Guido van Rossum added the comment: It's been deleted. Use 2to3; it will replace it with 'str'. -- components: +Documentation nosy: +gvanrossum type: compile error -> __ Tracker <[EMAIL PROTECTED]> <http:

[issue1607759] segfault in python24.dll

2008-01-25 Thread Guido van Rossum
Guido van Rossum added the comment: Without new information we can't really help with this, sorry. -- nosy: +gvanrossum resolution: -> rejected status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.pyt

[issue1942] test_plistlib started failing

2008-01-26 Thread Guido van Rossum
New submission from Guido van Rossum: Probably a merge glitch. -- components: Macintosh messages: 61724 nosy: gvanrossum priority: urgent severity: normal status: open title: test_plistlib started failing type: behavior versions: Python 3.0 __ Tracker

[issue1942] test_plistlib started failing

2008-01-26 Thread Guido van Rossum
Guido van Rossum added the comment: Fixed by Crys in r60333. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: Unfortunately I have no time to work on this myself, but in order to make progress I recommend checking in things piecemeal so that the same changes don't get reviewed over and over again. I propose that each submit reference this bug ("Partial fix

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: Don't create new bug reports! __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1621> __ ___ Python-bugs-list mailing

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: > for (i = 0; i < strlen(field) ; i++) { This looks inefficient. Why not for (i = 0; field[i] != '\0'; i++) { ??? __ Tracker <[EMAIL PROTECTED]> <http://

[issue1955] fix using unittest as a superclass

2008-01-28 Thread Guido van Rossum
Guido van Rossum added the comment: This patch seems to be based upon a misunderstanding of how Python namespaces work. -- keywords: +patch nosy: +gvanrossum resolution: -> rejected status: open -> closed __ Tracker <[EMAIL PROTECTE

[issue1621] Do not assume signed integer overflow behavior

2008-01-28 Thread Guido van Rossum
Guido van Rossum added the comment: I wonder if it would help making i a Py_ssize_t instead of an int? __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1621> __ ___

[issue1954] SocketServer.ForkingMixIn creates a zombie

2008-01-28 Thread Guido van Rossum
Guido van Rossum added the comment: Using signals is asking for all sorts of trouble. What is the point of collecting the last process? Having one zombie child max as a steady state strikes me as totally acceptable. -- nosy: +gvanrossum __ Tracker

[issue1956] Lib/bsddb/test/test_thread.py uses old 'except' syntax

2008-01-28 Thread Guido van Rossum
Guido van Rossum added the comment: Chris: I think it's worth running all tests before submitting a merge. Catch them early is what I say. :-) -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> <http://bugs.python

[issue1954] SocketServer.ForkingMixIn creates a zombie

2008-01-29 Thread Guido van Rossum
Changes by Guido van Rossum: -- resolution: -> wont fix status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1954> __ ___ Python

[issue1969] split and rsplit in bytearray are inconsistent

2008-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, that looks like a bug. -- keywords: +easy nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Guido van Rossum
Guido van Rossum added the comment: I'm fine with applying Michael's suggestion to 2.6. I're reverting the priority change though; using deepcopy is not OO and IMO usually indicates that there's something wrong with your app. -- sever

[issue846388] Check for signals during regular expression matches

2008-01-31 Thread Guido van Rossum
Guido van Rossum added the comment: I think this is worth backporting to 2.5.2. This and r60054 are the *only* differences between _sre.c in 2.5.2 and 2.6. Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/is

[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Guido van Rossum
Guido van Rossum added the comment: On Jan 31, 2008 2:54 PM, Michael Van Biesbrouck wrote: > Why do people want to use copy and deepcopy? I think that the issue is > that Python is an imperative language that passes and copies references. > If a library function doesn't treat it

[issue1978] Python(2.5.1) will be crashed when i use _ssl module in multi-threads environment in linux.

2008-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: I think it's worth applying this to 2.5.2 even if the patch is dead after that. More unittests are definitely in order. -- nosy: +gvanrossum priority: low -> normal __ Tracker <[EMAIL PROTEC

[issue1974] email.MIMEText.MIMEText.as_string incorrectly folding long subject header

2008-02-01 Thread Guido van Rossum
Changes by Guido van Rossum: -- assignee: -> barry nosy: +barry __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1974> __ ___ Python-bugs-li

[issue1975] signals in thread problem

2008-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: Actually I see the same behavior under Linux and OSX: the first ^C interrupts the select() call, after that ^C is ignored. -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue1981] operator "is"

2008-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: id(a.__abs__) == id(a.__abs__) has a completely different explanation -- it so happens that the first instantiation of a.__abs__ is freed after id() is called on it and the second instantiation happens to reuse that same memory block. -- nosy

[issue1985] Bug/Patch: Problem with xml/__init__.py when using freeze.py

2008-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: I think nobody really cares about freeze any more -- it isn't maintained. -- nosy: +gvanrossum priority: -> low __ Tracker <[EMAIL PROTECTED]> <http://bugs.pyt

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2008-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: I'm against including this in 2.5.2. It reeks of a new feature, and the code looks like it would risk breaking other apps. (I'm fine with adding this to 2.6 of course.) -- nosy: +gvanrossum _ Track

[issue1997] unicode and string compare should not cause an exception

2008-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: > As I understand it comparisons between two objects should > always work. Hi Aaron! Glad to see you're back. It used to be that way when you & Jim wrote the first Python book. :-) Nowadays, comparisons *can* raise exceptions. Marc-Andre ha

[issue1985] Bug/Patch: Problem with xml/__init__.py when using freeze.py

2008-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: Why don't you ask that question on python-dev? Maybe someone volunteers! __ Tracker <[EMAIL PROTECTED]> <http://bugs.python

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2008-02-02 Thread Guido van Rossum
Guido van Rossum added the comment: Understood. Can you get other developers on python-dev to weigh in? Maybe I am over-estimating the danger. _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/iss

[issue1997] unicode and string compare should not cause an exception

2008-02-02 Thread Guido van Rossum
Changes by Guido van Rossum: Removed file: http://bugs.python.org/file9348/unnamed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1997> __ ___ Python-bugs-list

[issue1997] unicode and string compare should not cause an exception

2008-02-02 Thread Guido van Rossum
Guido van Rossum added the comment: You should be grateful. :-) The error points out a bug in your program: you're mixing encoded and unencoded text. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-02-03 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW, if Rational(Decimal(...)) is to be accepted, then Decimal(Rational(...)) should also be accepted, and arguably mixed binary operations as well (Rational(...) + Decimal(...) etc.). -- assignee: gvanrossum -> jyass

[issue2002] Make int() fall back to trunc()

2008-02-03 Thread Guido van Rossum
Guido van Rossum added the comment: > Guido, are these basically the mechanics you intended? All calls to > PyNumber_Int() and PyNumber_Long() attempt the usual path and if those > would fail, it tries __trunc__ if it exists and coerces the result of > that call back to an int o

[issue1975] signals in thread problem

2008-02-04 Thread Guido van Rossum
Guido van Rossum added the comment: Well okay than I can confirm that OSX is *not* affected by this OS bugginess. -- keywords: +patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue2011] compiler.parse("1; ") adds unexpected extra Discard(Const(None)) to parse tree

2008-02-04 Thread Guido van Rossum
Guido van Rossum added the comment: What on earth is this about? __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2011> __ ___ Python-bugs-list mailing list Unsubs

[issue846388] Check for signals during regular expression matches

2008-02-04 Thread Guido van Rossum
Guido van Rossum added the comment: Backported to 2.5.2 as r60576. (The other deltas are not backported.) Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/is

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-02-07 Thread Guido van Rossum
Guido van Rossum added the comment: > > I have one minor nit on the current rational.py code: all internal > > accesses to the numerator and denominator should use self._numerator > > and self._denominator -- going through the properties makes it *much* > > slower. Remem

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-02-09 Thread Guido van Rossum
Guido van Rossum added the comment: Jeffrey: Yay for measurements! I was going to say that __add__ is inefficient because it makes so many function calls, but it turns out that, as you say, the cost of constructing a new Rational instance drowns everything else. On my 2.8GHz iMac, Rational(2,3

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-02-10 Thread Guido van Rossum
Guido van Rossum added the comment: > I'm not sure I like the idea of names Rational and Fraction; the two > classes numbers.Rational and rational.Rational are quite different beasts, > and using two almost-synonyms for their names seems like a bad idea. > Is there some more

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-02-10 Thread Guido van Rossum
Guido van Rossum added the comment: > Fair enough. Should it be fractions.Fraction or fraction.Fraction? I think "from fractions import Fraction" is linguistically more correct -- the concept is always mentioned in plural, but a fractional number is of course singular. We also

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-02-10 Thread Guido van Rossum
Guido van Rossum added the comment: Go for it! __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1682> __ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue2016] Crash when modifying the **kwargs passed to a function.

2008-02-11 Thread Guido van Rossum
Guido van Rossum added the comment: I have a proposed minimal fix, but I wonder if this would break existing code (apart from the exploit given here). Martin? (I think the discussion between Alexander and Amaury can be ignored for the purpose of reviewing the fix; only the exploit matters

[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Guido van Rossum
Guido van Rossum added the comment: > Okay, Nick; you've got me convinced. For some reason I wasn't really > thinking of these methods as alternative constructors---in this light, > your arguments about doing the same as __new__, and about established > patterns, make perf

[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-14 Thread Guido van Rossum
Guido van Rossum added the comment: Yay! And my benchmark went from 70 usec to 15 usec. Not bad! PS. Never use relative speedup numbers based on profiled code -- the profiler skews things tremendously. Not saying you did, just stating the obvious. :) __ Tracker

[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-14 Thread Guido van Rossum
Guido van Rossum added the comment: PS. I can shave off nearly 4 usec of the constructor like this: -self = super(Fraction, cls).__new__(cls) +if cls is Fraction: +self = object.__new__(cls) +else: +self = super().__new__(cls) This would seem to

[issue960406] unblock signals in threads

2008-02-15 Thread Guido van Rossum
Guido van Rossum added the comment: restore nosy list -- nosy: -sandylovesedward Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue960406> ___ Pyth

[issue1600] str.format() produces different output on different platforms (Py30a2)

2008-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: I would like Python to follow the C99 rule here. It is practical and Python has a long tradition of following C where it makes sense. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: A C reimplementation of gcd probably makes little sense -- for large numbers it is dominated by the cost of the arithmetic, and that will remain the same. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: I think this is definitely premature optimization. :-) In any case, before going any further, you should design a benchmark and defend it. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue2163] test_socket is flakey

2008-02-22 Thread Guido van Rossum
New submission from Guido van Rossum: I find that test_socket fails regularly (but not always) when run via "regrtest.py -uall". The message is always "socket is not connected" but it's unclear from which test it comes -- all I know is that it comes from tearDown() on

[issue1040026] os.times() is bogus

2008-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: Well, 8./5 equals 100/60. Go figure. _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1040026> _ ___ Python-bugs-

[issue1040026] os.times() is bogus

2008-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: test_times.py produces the correct value on Linux for me, but I see the same bogus value as Malte on OSX. _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/iss

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-24 Thread Guido van Rossum
New submission from Guido van Rossum: There are other ways of getting the same effects now (list() or zip() for map(None, ...)). -- keywords: easy messages: 62967 nosy: gvanrossum severity: normal status: open title: map and filter shouldn't support None as first argument (in Py3k

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-24 Thread Guido van Rossum
Changes by Guido van Rossum: -- components: +Interpreter Core type: -> behavior __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2186> __ ___ Python-bu

[issue2187] map and filter objects shouldn't call themselves itertools.imap and itertools.ifilter objects

2008-02-24 Thread Guido van Rossum
New submission from Guido van Rossum: Probably ifilter and imap should go (moving the code over to bltinmodule.c). -- components: Interpreter Core keywords: easy messages: 62968 nosy: gvanrossum severity: normal status: open title: map and filter objects shouldn't call thems

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Guido van Rossum
Guido van Rossum added the comment: Let me assign this to Raymond for the answering of the question about ifilterfalse. -- assignee: -> rhettinger nosy: +rhettinger __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue2163] test_socket is flakey

2008-02-25 Thread Guido van Rossum
Guido van Rossum added the comment: It seems to work now for me too. I'll keep an eye out though. -- resolution: -> works for me status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.

[issue2187] map and filter objects shouldn't call themselves itertools.imap and itertools.ifilter objects

2008-02-25 Thread Guido van Rossum
Changes by Guido van Rossum: -- assignee: -> rhettinger nosy: +rhettinger __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2187> __ ___ Python-bugs-li

[issue1394] simple patch, improving unreachable bytecode removing

2008-02-25 Thread Guido van Rossum
Guido van Rossum added the comment: On Mon, Feb 25, 2008 at 1:32 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > Unit tests are just for bugfixes. I presume you meant "are *not* just for bugfixes". __ Tracker <[EMAIL PROTECTED]>

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Guido van Rossum
Guido van Rossum added the comment: > What do you guys think about just making the predicate argument optional? > >filter([-2,0,2]) --> -2, 2 >filter(pred, iterable) > > One arg is the first case and two args is the second case. -1. Apart from range() this is

[issue2235] __eq__ / __hash__ check doesn't take inheritance into account

2008-03-04 Thread Guido van Rossum
Guido van Rossum added the comment: The py3k feature was intentional. I'm not sure who did the backport (could've been me, long ago). I think the backport should be replaced with a warning that is only issued when -3 is given. __ Tracker <[EM

[issue2235] __eq__ / __hash__ check doesn't take inheritance into account

2008-03-04 Thread Guido van Rossum
Guido van Rossum added the comment: > I noticed that my patch uses Py_TYPE(self)->tp_hash, whereas normal > processing of slot_tp_hash() uses lookup_method(self,"__hash__",hash_str). > > I am almost sure that both expressions return the same value. > Is this cor

[issue1733184] slice type is unhashable

2008-03-07 Thread Guido van Rossum
Guido van Rossum added the comment: Alexander nailed my motivation. Have the proponents for this change really thought through that making slices hashable means that henceforth this code will work? d = {} d[:] = [1, 2, 3] # surprise here print d # prints {slice(None, None

<    10   11   12   13   14   15   16   17   18   19   >