[issue1734] no effect if metaclass modifies dict

2008-01-03 Thread L. Peter Deutsch
New submission from L. Peter Deutsch: In the following, dir(Node) should include the name 'z', and Node.z should be 'Node'. However, dir(Node) does not include 'z', and Node.z is undefined (AttributeError). This is directly contrary to the Python documentation, whic

[issue1734] documentation on metaclasses is incomplete and misleading

2008-01-04 Thread L. Peter Deutsch
L. Peter Deutsch added the comment: Please reopen this issue as a documentation bug. The documentation for __new__ in section 3.4.1 says: __new__() is intended mainly to allow subclasses of immutable types (like int, str, or tuple) to customize instance creation. The documentation for

[issue1734] documentation on metaclasses is incomplete and misleading

2008-01-05 Thread L. Peter Deutsch
L. Peter Deutsch added the comment: Actually, "called" and "callable" are OK, if the documentation says somewhere that the normal effect of "calling" a type object is to invoke __new__. The places I looked first (sections 3.1, 3.3, and 3.4.1) do not say this. 5.3

[issue1518] Fast globals/builtins access (patch)

2008-01-05 Thread L. Peter Deutsch
L. Peter Deutsch added the comment: Sorry, I wrote "E's cached pointer to C.f", which of course should be "E's cached pointer to A.f". __ Tracker <[EMAIL PROTECTED]&g

[issue1518] Fast globals/builtins access (patch)

2008-01-05 Thread L. Peter Deutsch
L. Peter Deutsch added the comment: The proposed approach to speeding up lookup of inherited methods is not quite sound, given that class attributes can be added and removed dynamically. Consider: class A: def f(x): ... class B(A): pass class C(B): pass If C caches a pointer to A.f, the

[issue1733184] slice type is unhashable

2008-03-24 Thread L. Peter Deutsch
L. Peter Deutsch <[EMAIL PROTECTED]> added the comment: Having now read messages 63380 and 63384, I agree with them: I would have withdrawn my proposal if it hadn't gotten rejected first. I do have a use case, but the workaround is pretty easy. __

[issue16563] re.match loops forever on simple regexp

2012-11-26 Thread L. Peter Deutsch
New submission from L. Peter Deutsch: I've read a number of reports of exponential-time regexp matching, but this regexp uses no unusual features, requires no backtracking, and only loops "forever" on certain input strings. I listed the Python version # as 2.6; I actual

[issue16563] re.match loops forever on simple regexp

2012-11-26 Thread L. Peter Deutsch
L. Peter Deutsch added the comment: It never occurred to me that the regexp package would be so poorly designed that a pattern that so clearly never requires backtracking could require exponential time. I'll change the pattern (taking out the + has no effect on what strings it matches