[issue9131] test_set_reprs in test_pprint is fragile

2010-08-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> stutzbach ___ Python tracker <http://bugs.python.org/issue9131> ___ ___ Python-bugs-list mai

[issue9396] Standardise (and publish?) cache handling in standard library

2010-08-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue9396> ___ ___ Python-bugs-

[issue7871] Duplicate test method in test_heapq

2010-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r84255. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue8743] set() operators don't work with collections.Set instances

2010-08-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> high ___ Python tracker <http://bugs.python.org/issue8743> ___ ___ Python-bugs-list mailing list Unsubscri

[issue8403] dis.dis gives different results if Ctrl-C is pressed

2010-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r84256. Don't think this needs to be backported. -- resolution: -> fixed status: open -> closed versions: +Python 3.2 -Python 2.6, Python 2.7 ___ Python tracker <http://bugs.python

[issue9659] frozenset, when subclassed will yield warning upon call to super(...).__init__(iterable)

2010-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks Benjamin. I concur with your conclusion. -- ___ Python tracker <http://bugs.python.org/issue9659> ___ ___ Python-bug

[issue9685] tuples should remember their hash value

2010-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems reasonable. Will look at it in the next few days. -- assignee: -> rhettinger keywords: +easy nosy: +rhettinger priority: normal -> low stage: -> needs patch versions: +Python 3.2 -P

[issue9686] asyncore infinite loop on raise

2010-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: What change are you proposing? -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue9686> ___ ___ Python-bug

[issue9685] tuples should remember their hash value

2010-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Hello Tim! If you have a chance, please also take a look at issue9685 which I was planning to work on in the next couple of weeks. For memoizing tuple hashes, I'm inclined to think the one extra field is worth it. That would help all the cases

[issue9686] asyncore infinite loop on raise

2010-08-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> giampaolo.rodola nosy: +giampaolo.rodola ___ Python tracker <http://bugs.python.org/issue9686> ___ ___ Python-

[issue9702] Python violates most users expectations via the modification differences of immutable and mutable objects in methods

2010-08-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: -- ___ Python tracker <http://bugs.python.org/issue9702> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9702] Python violates most users expectations via the modification differences of immutable and mutable objects in methods

2010-08-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: The current design has existed for almost twenty years. It is deeply embedded in the language. For better or worse, it cannot and won't change. -- nosy: +rhettinger ___ Python tracker <http://bugs.py

[issue9119] Python download page needs to mention crypto code in Windows installer

2010-08-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: FYI, there is a section of the docs devoted to notifications and attribution licenses: http://docs.python.org/license.html#licenses-and-acknowledgements-for-incorporated-software -- nosy: +rhettinger ___ Python

[issue9705] limit dict.update() to a given list of keys

2010-08-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the usual way to spell this in Python is: my_dict_1.update((k, my_dict_2[k]) for k in ['a', 'c']) We try to keep filtering operations separate from map/fold operations for orthognality.

[issue4356] Add "key" argument to "bisect" module functions

2010-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > maybe the mention of the SortedCollection recipe should > be a little more prominent. Thanks for the suggestion. Will look at moving the note higher on the page. -- components: +Documentation -Library (Lib) status: closed -

[issue4356] Add "key" argument to "bisect" module functions

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r84383. -- resolution: duplicate -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue8685] set(range(100000)).difference(set()) is slow

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please leave this for me. Thank you. -- ___ Python tracker <http://bugs.python.org/issue8685> ___ ___ Python-bugs-list mailin

[issue9212] dict_keys purports to implement the Set ABC, but is missing the isdisjoint method

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be nice to get this fixed before the next release. -- ___ Python tracker <http://bugs.python.org/issue9212> ___ ___

[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for the basic idea. It could use a better name, Sequence.has_methods(range) reads backwards to me. Perhaps something like: Sequence.implemented_by(range) or Sequence.verify_full_api(range) or some such. Also, when the tests get added, they should go

[issue4819] Misc/cheatsheet needs updating

2010-09-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: -rhettinger ___ Python tracker <http://bugs.python.org/issue4819> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9042] Gettext cache and classes

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: The patch looks fine. -- nosy: +rhettinger resolution: -> accepted ___ Python tracker <http://bugs.python.org/iss

[issue8743] set() operators don't work with collections.Set instances

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: The operator methods in setobject.c should be liberalized to accept instances of collections.Set as arguments. For speed, they should continue to check PyAnySet_Check(other) first and then if that fails, fall back to testing PyObject_IsInstance(other

[issue9155] Reserve COMPARE_OP for rich comparisons

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm marking this one as rejected. The timings have shown mixed results (some favorable, some not). In general, there is a bias against expanding the number of opcodes because 1) there aren't that many codes available, 2) it grows the size of

[issue9634] Add timeout parameter to Queue.join()

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Kelly, thanks for posting the idea. I'm going to close this one for now but it can be reopened if compelling use cases arise. -- resolution: -> rejected status: open -> closed ___ Python tra

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am deferring this to Py3.3. There is a workaround available just using duck-typing and I would like to wait until more more has been done on StructSeq before setting committing to an new namedtuple Abstract Base Class (one released, it would be very hard

[issue1818] Add named tuple reader to CSV module

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unassigning, this needs fresh thought and a fresh patch from someone who can devote a little deep thinking on how to solve this problem cleanly. In the meantime, it is no problem to simply cast the CSV tuples into named tuples. -- assignee

[issue9269] Cannot pickle self-referencing sets

2010-09-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> low ___ Python tracker <http://bugs.python.org/issue9269> ___ ___ Python-bugs-list mailing list Unsubscri

[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_CONST

2010-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: This proposal hasn't gotten much love or support and I'm no longer interested in it. Aside from ''.join and '{}'.format, there doesn't seem to be many common cases, so there's no big win here. -- assign

[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

2010-09-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> terry.reedy priority: normal -> low ___ Python tracker <http://bugs.python.org/issue4395> ___ ___

[issue8743] set() operators don't work with collections.Set instances

2010-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Rough cut at a first patch is attached. Still thinking about whether Set operations should be accepting any iterable or whether they should be tightened to expect other Set instances. The API for set() came from set.py which was broadly discussed and

[issue9749] tuple-to-list conversion

2010-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, this isn't a bug. I think you've rediscovered a property of mutable objects. See http://docs.python.org/tutorial/controlflow.html#default-argument-values for an example. -- nosy: +rhettinger resolution: -> invalid status: o

[issue8420] Objects/setobject.c contains unsafe code

2010-09-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r84447 -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue9717] operator module - "in place" operators documentation

2010-09-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Consider breaking the operator module documents into sections, grouping all of the in-place ops into the last section. Start that section with a full description of how in-place works in python and show some examples of successful way to use the in-place

[issue9717] operator module - "in place" operators documentation

2010-09-03 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: d...@python -> rhettinger ___ Python tracker <http://bugs.python.org/issue9717> ___ ___ Python-bugs-list mai

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-09-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for PyObject_Hash returning a Py_ssize_t. Nothing good can come from having a hash table larger than the range of a hash value. Tests may pass but performance would degrade catastrophically. -- ___ Python

[issue9025] Non-uniformity in randrange for large arguments.

2010-09-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Put in a fix with r84576. May come back to it to see if it can or should be optimized with C. For now, this gets the job done. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue9379] random.randrange behaviour problems

2010-09-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Added a doc fix to r84576. Advice is "don't do that" ;-) -- resolution: -> fixed status: open -> closed ___ Python tracker <http://b

[issue7889] random produces different output on different architectures

2010-09-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r84574 and r84576. The seed function no longer uses hash() for str, bytes, or bytearray arguments. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue9080] Provide list prepend method (even though it's not efficient)

2010-09-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, this needs to stay closed. It has no chance. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue9

[issue9793] Typo fix in What's New for 3.2: dynmaic -> dynamic

2010-09-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: The sort of editing should be done *much* later. I expect to be updating the file every few days and occasionally running the out through a spelling and grammar checker. Right now, it's a work in progress that doesn't benefit from m

[issue9796] Add summary tables for unittest API

2010-09-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Just focus on the table for assert* methods. This is the one category that users will need to look-up over and over again. The goal is to make the docs more usable, not more voluminous. Also, I suggest finding meaningful groupings (don't stick

[issue9802] Document 'stability' of builtin min() and max()

2010-09-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: d...@python -> rhettinger ___ Python tracker <http://bugs.python.org/issue9802> ___ ___ Python-bugs-list mai

[issue7951] Should str.format allow negative indexes when used for __getitem__ access?

2010-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: After more thought, I'm -1 on this. "Consistency" is a weak argument in favor of this. We need to be more use case drivenm and it there is no evidence that this is needed. Also, there is a reasonable concern that using negative indi

[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger priority: normal -> low ___ Python tracker <http://bugs.python.org/issue9816> ___ ___ Python-bugs-

[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the report. Something does appear to be broken. When the states are different, the random numbers should be different. Am looking in to it. In the mean time, I recommend against using jumpahead() with MT. It is better to separately seed

[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: I see the problem now. Random.jumpahead(n) does a very poor job of shuffling MT's state when n is small. The first few numbers of the state are different but some of the later ones are not. When random() crawls across parts of the state tha

[issue8699] Equality and hashing for functools.partial

2010-09-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the interesting thread. I do agree with your suggestion to close this one though. -- nosy: +rhettinger resolution: -> rejected status: pending -> closed ___ Python tracker <http://bugs.p

[issue9823] OrderedDict is comparable to dict

2010-09-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: That is the documented and tested behavior: http://docs.python.org/library/collections.html#ordereddict-objects """ Equality tests between OrderedDict objects are order-sensitive and are implemented as list(od1.items())==list(od2.items()).

[issue9826] OrderedDict ref cycles break repr()

2010-09-10 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue9826> ___ ___ Python-bugs-list mai

[issue9826] OrderedDict ref cycles break repr()

2010-09-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Patch? -- priority: normal -> low ___ Python tracker <http://bugs.python.org/issue9826> ___ ___ Python-bugs-list mai

[issue9825] OrderedDict ref cycles cause memory leak

2010-09-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is an unfortunate aspect of using __del__. I don't see a way around it without reintroducing weak references. Of course, your code can also use weak ref proxies to avoid creating uncollectible circular garbage. -- priority: normal -

[issue9825] OrderedDict ref cycles cause memory leak

2010-09-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Éric, I've got this one. Thx. -- ___ Python tracker <http://bugs.python.org/issue9825> ___ ___ Python-bugs-list m

[issue9825] OrderedDict ref cycles cause memory leak

2010-09-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: For 2.7, removed __del__ in r84725. For 3.2, replaced __del__ with weakrefs in r84727. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue9826] OrderedDict ref cycles break repr()

2010-09-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r84728 and r84729. Will backport to 2.7 shortly. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue9840] Recursive Repr

2010-09-12 Thread Raymond Hettinger
New submission from Raymond Hettinger : Add a recursive_repr() decorator to provide a solution to the problem of creating a container __repr__ method that doesn't fail for recursive calls. -- files: recursive_repr.patch keywords: patch messages: 116239 nosy: rhettinger priority: n

[issue7951] Should str.format allow negative indexes when used for __getitem__ access?

2010-09-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- components: +Documentation -Interpreter Core ___ Python tracker <http://bugs.python.org/issue7951> ___ ___ Python-bugs-list m

[issue9840] Recursive Repr

2010-09-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Committed in r84792. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue9802] Document 'stability' of builtin min() and max()

2010-09-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Documented the current behavior in r84822. Mark, if you're free on IRC at some point, I would like to discuss further. -- ___ Python tracker <http://bugs.python.org/i

[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: I have a hard time caring about this. The main value of sys.getsizeof() is to enable developers to determine the internal sizes of basic objects on a given build. IIRC, there was no intention for this to become a requirement for pure python classes

[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- keywords: +patch stage: -> patch review type: behavior -> feature request Added file: http://bugs.python.org/file18896/od_size.diff ___ Python tracker <http://bugs.python.org/

[issue6893] defaultdict example in py3 doc should mention the new Counter class

2010-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: This example needs to stay. It was one of the principal motiviating use cases for defaultdict and it is a good, simple, understandable example of how to use it. Also, I don't want to cross-link these two tools because they a subtly different

[issue9886] Make operator.itemgetter/attrgetter/methodcaller easier to discover

2010-09-17 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: d...@python -> rhettinger nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue9886> ___ ___ Python-

[issue1739789] Accelerate attr dict lookups

2010-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: This was an interesting idea. Essentially, it created cell-style objects for entries in a global dict so that functions using load_global could access and update the values directly. All dicts paid a price for this, but only module dicts would benefit

[issue1744752] Newline skipped in "for line in file" for huge file

2010-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: We need a reproducible test before being able to go forward with this. At the very least, that would help isolate whether this is a build specific C library issue. -- nosy: +rhettinger resolution: -> invalid status: open ->

[issue1686] string.Template.safe_substitute fail when overriding pattern attribute

2010-09-18 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg63791 ___ Python tracker <http://bugs.python.org/issue1686> ___ ___ Python-bugs-list m

[issue1686] string.Template.safe_substitute fail when overriding pattern attribute

2010-09-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks fine. -- assignee: barry -> resolution: -> accepted ___ Python tracker <http://bugs.python.org/

[issue1708652] Exact matching

2010-09-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Can we close this one? -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue1708652> ___ ___ Python-bug

[issue9896] Introspectable range objects

2010-09-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't see anything wrong with this idea, but I don't really see a need for it either. AFAICT, this has never been requested in the 20 years that range() has been in Python. This is probably YAGNI. It may also be in violation of the

[issue9896] Introspectable range objects

2010-09-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought. If there is a perceived need, I would rather an alternate approach that unifies a language a bit by letting range() expose its arguments as a slice and modify its input to accept a slice. >>> range(0, 20, 2).slice slice(

[issue1708652] Exact matching

2010-09-18 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue1708652> ___ ___ Pyth

[issue2180] tokenize: mishandles line joining

2010-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mark, please stop closing these based on age. The needs to be a determination whether this is a valid bug. If so, then a patch is needed. If not, it can be closed. -- assignee: jhylton -> nosy: +rhettinger status: pending ->

[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: See r84852 -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue9865> ___ __

[issue8743] set() operators don't work with collections.Set instances

2010-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: After discussion on IRC, have decided to make the Set ABC more closely match setobject.c: 1) loosen setobject.c binary operations to accept any Set rather than any set/frozenset (see attached patch). 2) tighten Set.__or__, etc to only accept Set rather

[issue6305] islice doesn't accept large stop values

2010-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unassigning. If someone is interested creating a patch, I think it is a reasonable request. -- assignee: rhettinger -> priority: low -> normal stage: -> needs patch versions: -Python 2.7 ___ Pytho

[issue8743] set() operators don't work with collections.Set instances

2010-09-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg116998 ___ Python tracker <http://bugs.python.org/issue8743> ___ ___ Python-bug

[issue8743] set() operators don't work with collections.Set instances

2010-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: After discussion on IRC, have decided to make the Set ABC more closely match setobject.c by loosening setobject.c binary operations to accept any Iterable rather than any just a set/frozenset. -- ___ Python

[issue9906] including elementary mathematical functions in default types

2010-09-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> invalid status: open -> closed ___ Python tracker <http://bugs.python.org/issue9906> ___ ___ Python-bugs-

[issue9915] speeding up sorting with a key

2010-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Conceptually, this is a reasonable approach. I originally put in the sortwrapper as a straight-forward technique of tackling the 2.x API which allowed a key-function, or a cmp-function, or both, or neither. IOW, the original motivation is now gone

[issue9959] int(math.log(4,2)) == 1 instead of 2

2010-09-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: It is not a reasonable request for math float functions to produce exact integer values and there is some harm in making further alterations to the existing algorithm (the more you tweak it in one place, the more you create oddities somewhere else

[issue5131] pprint doesn't know how to print a defaultdict

2010-09-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Ben, I don't think there is any value is opening more issues like pprint-doesn't-handle-object-x (named tuples, defautdicts, deques, generators, etc). As it is currently designed, pprint doesn't offer usable hooks and it is not easy

[issue9974] tokenizer.untokenize not invariant with line continuations

2010-10-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue9974> ___ ___ Python-bugs-list mai

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: In the past, we've allow ceval.c to peer through encapsulation in order to have fast paths. -- ___ Python tracker <http://bugs.python.org/i

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: At any rate, I believe this used to be a fast-path. IIRC, Aahz put it in after demonstrating a considerable speed boost for common cases. Aahz, do you have any institutional memory around this one? -- nosy: +aahz

[issue10025] random.seed not initialized as advertised

2010-10-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker <http://bugs.python.org/issue10025> ___ ___ Python-bugs-list mailing list Un

[issue10029] bug in sample code in documentation

2010-10-05 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: d...@python -> rhettinger ___ Python tracker <http://bugs.python.org/issue10029> ___ ___ Python-bugs-list mai

[issue10042] total_ordering stack overflow

2010-10-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks, this is a good idea. -- ___ Python tracker <http://bugs.python.org/issue10042> ___ ___ Python-bugs-list mailin

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll update the docs with an equivalent that works and that has a comment showing when the StopIteration is raised and caught. -- ___ Python tracker <http://bugs.python.org/is

[issue4907] ast.literal_eval does not properly handled complex numbers

2010-10-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed handling on unary minus in r85314. In so doing, it also liberalized what literal_eval() accepts (3j+4 for example). This simplified the implementation and removed an unnecessary restriction which wasn't needed for "safety".

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Refuse the temptation to hypergeneralize ;-) Also refuse the temptation to double the size of the docs (more != better). In the case of min/max, the pure python versions may add some value in showing that the first match is what is returned. But the code

[issue7771] dict view comparison methods are not documented

2010-10-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: We should probably just make reference to the collections.Set() abstract API instead of listing out all operations. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue7

[issue7771] dict view comparison methods are not documented

2010-10-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: The '^' corresponds to the __xor__ magic method. snip from _abcoll.py: def __xor__(self, other): if not isinstance(other, Set): if not isinstance(other, Iterable): return NotImplemented ot

[issue10025] random.seed not initialized as advertised

2010-10-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Perhaps replace equivalent with "based on" or some such. This is a very minor nit and likely of interest to no one except the OP. -- priority: normal -> low ___ Python tracker <http:/

[issue10059] add the method `index` to collections.deque

2010-10-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: The absence of index() from collections deque wasn't an oversight. Deques are not really about indexed access, they are about appending and popping from the ends. I'm curious about your use case and whether it is a good match for this data

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Max, thanks for reporting this. I've replaced the sample code, making it work correctly and more clearly showing the logic. See r85345 and r85346. Daniel, we need to sync-up on the meaning of marking a report as "accepted". Traditionall

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue10029> ___ ___ Python-bugs-list mailing list Unsubscri

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please pass the word along if you get a chance :-) -- ___ Python tracker <http://bugs.python.org/issue10029> ___ ___ Pytho

[issue10061] ** operator yielding wrong result for negative numbers

2010-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Python's order of operations runs the exponentation before the unary minus. This convention makes the unary minus behave more like the subtraction operator so that: -x**n == 0 - x**n. This convention is somewhat common but there are exceptions su

[issue10067] itertools' docs put izip_longest in the "terminating on the shortest input sequence" section

2010-10-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I saw that when I put in in. It doesn't fit the overall category but it does belong in the same general grouping and the notes make the semantics clear, so there is no harm in it and I like the current presentation better than the alterna

[issue10067] itertools' docs put izip_longest in the "terminating on the shortest input sequence" section

2010-10-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue10067> ___ ___ Python-bugs-list mailing list Unsubscri

[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Are you sure that this is useful enough to warrant inclusion in the standard lib? I don't know of anyone else who has used the same idiom. It seems crufty to me -- something that adds weight (mental burden and maintenance effort) without adding

<    1   2   3   4   5   6   7   8   9   10   >