[issue1165] Should itertools.count work for arbitrary integers?

2007-09-16 Thread Raymond Hettinger
Changes by Raymond Hettinger: -- assignee: - rhettinger nosy: +rhettinger __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1165 __ ___ Python-bugs-list mailing list

[issue10461] Use with statement throughout the docs

2010-11-20 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Do not change the examples in collections.rst. That would interfere with the clarify of what is being demonstrated. For example, the hamlet.txt example is not about file reading, it about counting words. -- nosy

[issue10461] Use with statement throughout the docs

2010-11-20 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I think the other (non collections patches) are fine. The change doesn't break up the flow of the text. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue10461] Use with statement throughout the docs

2010-11-20 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Separate note for Éric: the try/finally examples do not need to change. Those are valid python. Users need to learn both try/finally and the with-statement. -- assignee: d...@python - rhettinger

[issue9746] All sequence types support .index and .count

2010-11-20 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Patch is fine. Go ahead and apply. -- nosy: +rhettinger resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9746

[issue10476] __iter__ on a byte file object using a method to return an iterator

2010-11-20 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: FWIW, an idiom I use in Py2.x is: for block in iter(partial(f.read, BLKSIZ), ''): . . . This works with both single bytes at time and multiple bytes at a time. -- nosy: +rhettinger

[issue9909] request for calendar.dayofyear() function

2010-11-20 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: We already got one, and it's very nice-a ISTM, this should be done with regular date arithmetic in the datetime module. date(1964, 7, 31) - date(1963, 12, 31) datetime.timedelta(213) I don't see why we need a new function

[issue7770] sin/cos function in decimal-docs

2010-11-20 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Added a comment to the docstring. See r86631. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7770

[issue7770] sin/cos function in decimal-docs

2010-11-20 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7770

[issue10488] Improve documentation for 'float' built-in.

2010-11-21 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: d...@python - mark.dickinson resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10488

[issue1560032] confusing error msg from random.randint

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Sorry, it's time to close this one. The code is not buggy, it is documented as being a bound method and that is a perfectly acceptable python coding style to use bound methods as callables. It's also been around

[issue10461] Use with statement throughout the docs

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Éric, please apply most of these. In the atexit patch, the first change is wrong. Change it to a try/except/finally or skip it altogether. In the collections patch, only include the change for the tail example; the other

[issue10356] decimal.py: hash of -1

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Committed the ValueError in r86517 (py3k) As discussed on IRC, I've reverted this change. -- resolution: fixed - invalid status: open - closed ___ Python tracker rep

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

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: As discussed with Mark, am closing this one after having applied documentation changes. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue5353] Improve IndexError messages with actual values

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I'm abandoning this one since I couldn't find a way to do it that didn't impair performance. Unlike C++, it is not uncommon in Python to use exceptions such as IndexError for control flow. There was too little added value

[issue6722] collections.namedtuple: confusing example

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: See r86650 -- resolution: - fixed status: open - closed versions: -Python 2.6, Python 2.7, Python 3.0, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue7212] Retrieve an arbitrary element from a set without removing it

2010-11-21 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7212

[issue7257] Improve documentation of list.sort and sorted()

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: After more thought, am leaving the doc strings as-is. They are succinct and accurate. I have updated the sorting how-to to more thoroughly cover the basics of sorting. -- resolution: - wont fix status: open

[issue3292] Position index limit; s.insert(i,x) not same as s[i:i]=[x]

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Added the i,j,k notes Left out the processor word size and C-type specifications in-part because it is an implementation detail subject to change. Another reason is that it doesn't apply to necessarily to all sequences

[issue3292] Position index limit; s.insert(i,x) not same as s[i:i]=[x]

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: See r3292. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3292

[issue7049] decimal.py: Three argument power issues

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: +1 for deprecating three-arg pow for the reasons given. A user is much better-off composing well-defined operations than using our short-cut, with our chosen assumptions. Apologies for taking so long to think this one through

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Rejecting this one for reasons we discussed earlier. The assertEqual() method needs to be the primary interface. Everything else is starting to mix content and presentation (i.e. passing in separators). The existing repr

[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I don't have any other insights on this one. Assigned by to Antoine who appears to have put some thought into it. -- assignee: rhettinger - pitrou ___ Python tracker rep

[issue7434] general pprint rewrite

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Deferring the general rewrite until 3.3. It would need to have a lot of people look at it and evaluate it. I no longer think there is time for that before the 3.2 beta. -- resolution: - later versions: +Python 3.3

[issue10366] Remove unneeded '(object)' from 3.x class examples

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: These mostly look good. Do leave the howto documents as-is. They have some value across multiple versions of Python. Also, the descriptor how-to in particular gets some benefit from keeping (object) explicit because

[issue10138] calendar module does not support years outside [1, 9999] range

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Go ahead an remove the word indefinitely. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10138

[issue5150] IDLE to support reindent.py

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Opened back up for the new patch (posted after the previous close). -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5150

[issue10461] Use with statement throughout the docs

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I’m not 100% sure I should change 'r' to 'rb' in logging: It’s unrelated to with, and the rest of the file has not been checked for similar errors. Good catch. This should only be a with-statement transformation. I

[issue9915] speeding up sorting with a key

2010-11-22 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thanks for the revisions and timing updates. I'm heartened that the common-case of sorting without a key function isn't negatively impacted. That result is surprising though -- I thought the concept was manipulate the key

[issue9915] speeding up sorting with a key

2010-11-22 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: If the key parameter was not used, then the values pointer is a null pointer. . . . Since the branch will always be the same throughout any given call to sort(), CPU branch prediction is effective making the branches

[issue10511] heapq docs clarification

2010-11-23 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: That looks fine. Perhaps s/trees/binary trees -- assignee: rhettinger - georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10511

[issue10516] Add list.clear() and list.copy()

2010-11-23 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Guido approved these both in a thread earlier this year. The reasoning for copy() was the same as for clear(), some folks couldn't cope with: b = a[:] -- nosy: +rhettinger title: Add list.clear() - Add

[issue10519] setobject.c no-op typo

2010-11-24 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10519

[issue10519] setobject.c no-op typo

2010-11-24 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Try to match the whitespace convention of the surrounding code. -- assignee: rhettinger - anthonybaxter nosy: +anthonybaxter resolution: - accepted ___ Python tracker rep

[issue10519] setobject.c no-op typo

2010-11-24 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: A few lines later, a similar change can be made for set_discard. -- assignee: anthonybaxter - arigo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10519

[issue10533] defaultdict constructor with a concrete value

2010-11-25 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: lukasz.langa - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10533

[issue10533] defaultdict constructor with a concrete value

2010-11-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: It would be very handy to allow for concrete values as well. Do you have use cases for a concrete integer value that isn't zero? Since we can currently use defaultdict(int) or defaultdict(tuple), is the purpose just

[issue10533] Need example of using __missing__

2010-11-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: [Łukasz Langa] __missing__ didn't appear to be the one obvious way to anyone. Two thoughts: * There is part of the Zen that says that way may not be obvious unless your Dutch. In this case, __missing__ was the API

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-11-25 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: michael.foord - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10242

[issue10273] Clean-up Unittest API

2010-11-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: After discussion with Michael and Guido, am limiting this to: * Fixing assertItemsEqual as described in issue10242 * Moving the docs for type specific equality methods inside the docs for assertEqual to emphasize that those

[issue10273] Clean-up Unittest API

2010-11-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Yes, all the variants of RegexpMatches -- Regex No, on deprecations. Just add a new alias and note in the docs that the oldname is obsolete. Naming deprecations cause too much trouble for too little benefit

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-11-26 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Mark, can you opine on this? -- assignee: belopolsky - lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-11-27 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Applied in r86828. The output could still be made nicer, perhaps something along the lines of: expected 6, got 4: 'wand of fireballs' expected 2, got 7: 'ring of invisibility' . . . -- priority: high - normal

[issue10544] yield expression inside generator expression does nothing

2010-11-27 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Hmm, what an interesting and unexpected side-effect of the efforts to hide the loop induction variable. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-11-27 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Attaching possible code for nicer output. -- assignee: rhettinger - michael.foord resolution: fixed - Added file: http://bugs.python.org/file19833/nice_output.diff ___ Python

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-11-27 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I suggest Py_UNICODE_ADVANCE() to avoid false suggestion that the iterator protocol is being used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: A possible solution could be in collections.Iterator.__subclasshook__ checking for both required methods. That makes sense. PEP 234 requires iterators to support both methods. -- assignee: - rhettinger

[issue10544] yield expression inside generator expression does nothing

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: This discussion should probably be moved to python-dev. With tools like Twisted's inlineDefer or the Monocle package, there is a growing need to be able to use yield in complex expressions. Yet, that goes against the trend

[issue3243] Support iterable bodies in httplib

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Instead of hasattr(str,'next') consider using isinstance(str, collections.Iterable) Also consider changing the variable name from the now overly type specific, str to something like source to indicate

[issue5150] IDLE to support reindent.py

2010-11-28 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: rhettinger - ned.deily nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5150

[issue10273] Clean-up Unittest API

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Ezio, please do the regexp--regex changes and move the tests under Lib/test. -- assignee: rhettinger - ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Fixed in r86857. Needs backport. -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10565

[issue10572] Move unittest test package to Lib/test

2010-11-29 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Of those, it makes the most sense to move the json tests to Lib/tests. Bob is not externally maintaining the 3.x version. It's all our now. Also, it looks like importlib is in a maintenance mode now. There is merit

[issue5863] bz2.BZ2File should accept other file-like objects.

2010-11-29 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Without a patch and compelling use cases, this has no chance. Recommend closing. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5863

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-29 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Alexander, do you want to take care of the backport? -- assignee: rhettinger - belopolsky nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org

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

2010-11-29 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- Removed message: http://bugs.python.org/msg117005 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8743

[issue10323] Final state of underlying sequence in islice

2010-11-29 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Fixed in r86874. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10323

[issue10586] Enhanced cache access API for functools.lru_cache

2010-11-29 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Okay, go ahead with the second patch. With the following changes: _CacheInfo = namedtuple(CacheInfo, maxsize size hits misses) Change the variable names: cache_hits -- hits cache_misses -- misses Add

[issue10586] Enhanced cache access API for functools.lru_cache

2010-11-29 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thx -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10586 ___ ___ Python

[issue7830] Flatten nested functools.partial

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Alexander, I don't see anything wrong with patch, nor anything compelling about it either. It's your choice whether or not to apply. -- ___ Python tracker rep...@bugs.python.org

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

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thx. -- assignee: rhettinger - pitrou resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8685

[issue9915] speeding up sorting with a key

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: +1 on the basic idea of moving elements in the keys and values arrays at the same time thereby eliminating the fragmented memory overhead of the sortwrapper indirection. I would like the patch to be restricted to just

[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Deferring to 3.3. -- priority: normal - low versions: +Python 3.3 -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8425

[issue6422] timeit called from within Python should allow autoranging

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: This does not conflict with the other proposed changes to timeit and it is in-line with Guido's desire that to expose useful parts currently buried in the command-line logic. Amaury, you've shown an interest. Would you

[issue6594] json C serializer performance tied to structure depth on some systems

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Antoine, what do you want to do with the one? Without a good test case the OP's original issue is undiagnosable. -- assignee: rhettinger - pitrou versions: +Python 3.1 ___ Python

[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Any new logic should make maximum use of existing tools: def __isub__(self, other) if len(other) len(self)*8: other = self other . . . # rest of isub unchanged -- stage: patch review - needs

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

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Daniel, do you have time to work on this one? If so, go ahead an make setobject.c accept any instance of collections.Set and make the corresponding change to the ABCs: def __or__(self, other): if not isinstance

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

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: No need to rush this for the beta. It's a bug fix and can go in at any time. The important thing is that we don't break the C code. The __ror__ magic method would still need to do the right thing and the C code needs

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
New submission from Raymond Hettinger rhettin...@users.sourceforge.net: Nick, I may have found a straight-forward way to incorporate your idea for the cache to support maxsize=None. Let me know what you think. -- assignee: ncoghlan components: Library (Lib) files: cache.diff keywords

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: Added file: http://bugs.python.org/file19887/cache2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10593

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: Removed file: http://bugs.python.org/file19886/cache.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10593

[issue7434] general pprint rewrite

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Attaching a rough concept of how to make the existing pprint module extendible without doing a total rewrite. The actual handler is currently bogus (no thought out), so focus on the @guard decorator and the technique

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Applied in r86911. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10593

[issue10592] pprint module doesn't work well with OrderedDicts

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I'll discuss with Benjamin. This could be construed as a simple bug fix. The code is already in Py3.1. Line 155: - items = _sorted(object.items()) + items = (list if issubclass(typ, OrderedDict) else _sorted)(object.items

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: This is fine. Go ahead and backport if you feel so inclined. -- assignee: d...@python - eli.bendersky nosy: +rhettinger priority: normal - low resolution: - accepted versions: -Python 2.6

[issue5088] optparse: inconsistent default value for append actions

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Note, the :attr:`~Option.dest` variable is a list which includes default values if any are defined. Options on the command-line are appended to this list. Accordingly, the list may contain both the default value

[issue9915] speeding up sorting with a key

2010-12-01 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thanks. This nice, clean diff is much more reviewable and it looks like what I expected. The use of Py_LOCAL_INLINE is new to me since we usually use #define instead, but this has a cleaner look to it. I am unclear

[issue9915] speeding up sorting with a key

2010-12-01 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Just for the record, I wanted to highlight how little room there is for optimization here. The sort wrapper is *very* thin: sortwrapper_richcompare(sortwrapperobject *a, sortwrapperobject *b, int op

[issue9915] speeding up sorting with a key

2010-12-02 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: AP: I've already given my blessing to the patch. Just wanted to note what the existing code did. I also trust timings but recognize that they reflect a particular build configuration (compiler/processor/o.s)and the usage

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: If this change were important, the numpy/scipy guys would have requested it long ago. Any possible benefit would be slight and not at all worth the disruption. s.replace('j', 'i') -- nosy: +rhettinger

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Since we have two distinct user groups (engineers and everyone else), it's clear that we should fork Python. That would let each group work with their on most-natural-representation and it would prevent unnecessary

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Can you now implement the letter 'i' to act as an imaginary unit? Is that possible? Yes, it's possible; however, the developers do not think it is worthwhile. If it's possible in MATLAB, why not have both 'j' and 'i

[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Try not to sprawl this all over the docs. Find the most common root and document it there. No need to garbage-up Fractions, Decimal etc. with something that is of zero interest to 99.9% of users. -- nosy

[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Try not to twist yourself in a knot over this. I'll be happy to review in proposed doc patch. -- assignee: d...@python - rhettinger ___ Python tracker rep...@bugs.python.org http

[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- Removed message: http://bugs.python.org/msg123190 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10610

[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Let me know when you have a proposed doc patch. Ideally, the details should just be in one place and we can refer to it elsewhere. We don't want to add extra info to every function or method in Python that uses int(s

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-03 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- nosy: -rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10562

[issue10516] Add list.clear() and list.copy()

2010-12-04 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - rhettinger keywords: +easy -patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516

[issue6101] SETUP_WITH

2010-12-04 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Yes, someone went nuts with renumbering. That is allowed but was probably unnecessary. That being said, users of opcodes should really use the names in opcode.py instead of the numbers themselves. -- nosy

[issue10516] Add list.clear() and list.copy()

2010-12-04 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Nothing will happen on this until 3.2 is done and the py3k branch starts with 3.3 submissions. -- resolution: - later ___ Python tracker rep...@bugs.python.org http

[issue10648] Extend peepholer to reverse loads or stores instead of build/unpack

2010-12-07 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - rhettinger nosy: +rhettinger priority: normal - low versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10648

[issue10648] Extend peepholer to reverse loads or stores instead of build/unpack

2010-12-07 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thanks for the patch. I had looked at this long ago when I first added the ROT2 optimization and the ROT3/ROT2 optimization. It wasn't included because it wasn't worth the added complexity in the peepholer logic

[issue7391] Re-title the Using Backslash to Continue Statements anti-idiom

2010-12-08 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I'll take that section out. -- assignee: d...@python - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7391

[issue10667] collections.Counter object in C

2010-12-09 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thanks for the patch. FWIW, I'm attaching some timing code that I've used in the past. -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue10667] collections.Counter object in C

2010-12-09 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: Added file: http://bugs.python.org/file19993/time_counter.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10667

[issue10675] unittest should have an assertChanges context manager

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I concur with David Murray. Usually you care about the specific value changed to, not whether it changed at all. The changed-by variant is even more specialized and you're better of using assertEqual since you know what

[issue10675] unittest should have an assertChanges context manager

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thanks for submitting the idea though. Perhaps, post it on the ASPN Cookbook or on the newsgroup to see if others are interested. -- ___ Python tracker rep...@bugs.python.org http

[issue2690] Precompute range length and enhance range subscript support

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Applied in r87162 -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2690

[issue10667] collections.Counter object in C

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I would like this API to sit and cook for a good while. There are many possible ways to add more methods and most be end-up being YAGNI. Also, my experience with dict.fromkeys() is that a fair number of people get confused

[issue2690] Precompute range length and enhance range subscript support

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Is the in/not-in fast path in 2.7? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2690

  1   2   3   4   5   6   7   8   9   10   >