Changes by Raymond Hettinger:
--
assignee: - rhettinger
nosy: +rhettinger
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1165
__
___
Python-bugs-list mailing list
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
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
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
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
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
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
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
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7770
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
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
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
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
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
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
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
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7212
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
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
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
See r3292.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3292
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
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
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
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
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
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
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
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
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
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
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
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
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10519
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
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
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
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
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
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: michael.foord - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10242
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Thx
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10586
___
___
Python
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
nosy: -rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10562
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
keywords: +easy -patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10516
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
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
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
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
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
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
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
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
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
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
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
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 - 100 of 9507 matches
Mail list logo