Raymond Hettinger added the comment:
Attaching timing code.
Results with and without patch (as cleaned-up):
7.1 seconds without patch
3.2 seconds with patch
--
Added file: http://bugs.python.org/file21537/time_cmp_to_key.py
___
Python tracker
Raymond Hettinger added the comment:
Attaching cleaned-up version of the patch, making it more like the pure python
version:
* Made 'obj' a member so it is an accessible field
* Accept keyword arguments
* Create arg tuple like was done in the Py2.7 code
* Create the zero only once
Raymond Hettinger added the comment:
Thanks for the patch Filip.
Closing this. If anyone wants to lobby the RM for a 3.2 backport, feel free to
re-open and assign to the release manager for consideration.
--
status: open -> closed
___
Pyt
Raymond Hettinger added the comment:
> functools_cmp_to_key() doesn't
> check that the argument is a callable.
I don't think that is necessary; it will fail with a TypeError when the attempt
is made to call it. This is the approach we take elsewhere (look at the
built-in f
Raymond Hettinger added the comment:
Sorry, this is at odds with how Guido wants bool to work with containers. The
bool check is all about whether or not a container is empty, not about its
contents.
--
resolution: -> invalid
status: open ->
Raymond Hettinger added the comment:
We could do that, but that's not the Python way :-)
Really, you should be posting recipes somewhere else to see if there is
interest and uptake. The tracker is not the right place to toss one random
idea after another.
We need to place some value o
Raymond Hettinger added the comment:
After more thought, I've decided to close this feature request. The operation
is utterly trivial and isn't worth fattening the API. I see no advantage in
`c.total_count()` versus `sum(c.values())`.
--
resolution: -> rejected
Raymond Hettinger added the comment:
> why keyobject_type needed traverse function?
I used to know this but don't any more. It might not be necessary. Most of
the types I write all use GC so it may just be habit.
--
___
Python tracke
Raymond Hettinger added the comment:
Georg, do you care to opine on whether this should go into 3.2.1? (I don't
have any preference).
There is a big thread on comp.lang.python where a number of people seem to be
very concerned about the efficiency of cmp_to_key(). OTOH, we almost
Raymond Hettinger added the comment:
> How is it "not the Python way"?
Because having an API within an API greatly complexifies the interface, making
harder to implement, harder to understand, and harder to learn.
> Why is it okay to make `dict.keys` into a smart object
>
Raymond Hettinger added the comment:
One thing that could be done is to have an optional warning in the mutating
concrete C API functions that gets triggered whenever the input doesn't have an
exact type match. That will let people discover incorrect uses.
We could also scour our own s
Raymond Hettinger added the comment:
I concur with Benjamin.
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11788>
___
___
Python-bug
Raymond Hettinger added the comment:
I also recommend closing this one.
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11771>
___
___
Pytho
Raymond Hettinger added the comment:
This should get fixed, but I'm *really* curious about what kind of code
actually needs to do this ;-)
--
keywords: +easy
nosy: +rhettinger
type: -> behavior
___
Python tracker
<http://bugs
Changes by Raymond Hettinger :
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11571>
___
___
Python-bugs-list mailing list
Unsubscribe:
Raymond Hettinger added the comment:
> Not keeping tests alive for the whole run seems like a
> good thing
+1
> and either implementation seems fine to me.
I slightly prefer Fabio;s assignment to None approach (for subtle reasons that
I can't articulate at the moment).
-
Raymond Hettinger added the comment:
Miki: That's a really great use case. Thanks.
--
priority: normal -> high
___
Python tracker
<http://bugs.python.org
Raymond Hettinger added the comment:
FWIW, I prefer the whole file approach.
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11800>
___
___
Changes by Raymond Hettinger :
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11796>
___
___
Python-bugs-list mailing list
Unsubscribe:
Raymond Hettinger added the comment:
Also see issue 11698
--
assignee: jackdied -> rhettinger
___
Python tracker
<http://bugs.python.org/issue1820>
___
___
Py
Raymond Hettinger added the comment:
Also see issue11698
--
assignee: -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/iss
Raymond Hettinger added the comment:
> Devs are aware that there is an exception to the general rule
> for the 'for' clause. There is a technical reason why the
> exception is possible, though I have forgotten it.
It is best understood when thinking about a gexexp that
get
Raymond Hettinger added the comment:
> Hasn't this been fixed in the following changeset?
It was a major step forward. Now there needs to be work on other namedtuple
methods and whatnot.
--
___
Python tracker
<http://bugs.python.or
Raymond Hettinger added the comment:
I question whether this should be backported. Please discuss with the RM.
--
___
Python tracker
<http://bugs.python.org/issue11
Raymond Hettinger added the comment:
Georg, would you opine on whether this should to into 3.2.1?
--
status: closed -> open
___
Python tracker
<http://bugs.python.org/issu
Raymond Hettinger added the comment:
I agree (and was going back and forth between +0 and -0).
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issu
Raymond Hettinger added the comment:
[Uncle Timmy]
> Would have to look at the history to see who added it, and ask them.
That would be me :-)
At the time, the goals were to:
1) make an easy-to-use, readable output format for file comparisons,
2) use the unmodified output of the exist
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
priority: normal -> low
___
Python tracker
<http://bugs.python.org/issue11747>
___
___
Pyth
Raymond Hettinger added the comment:
Inspecting the text disassembly is a bit fragile for testing. It would be
better to scan a list of (opcode, oparg) pairs for given pattern (i.e.
(LOAD_CONST, 3) where consts[3] --> some target value).
--
nosy: +rhettin
Raymond Hettinger added the comment:
Yep!
--
___
Python tracker
<http://bugs.python.org/issue11816>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Raymond Hettinger :
Now that list comprehensions mask run their internals in code objects (the same
way that genexps do), it is getting harder to use dis() to see what code is
generated. For example, the pow() call isn't shown in the following
disassembly:
>>&
New submission from Raymond Hettinger :
The argument to CALL_FUNCTION is overloaded to show both the number of
positional arguments and keyword arguments (shifted by 8-bits):
>>> dis("foo(10, opt=True)")
1 0 LOAD_NAME0 (foo)
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
___
Python tracker
<http://bugs.python.org/issue11816>
___
___
Python-bugs-list mailing list
Un
Raymond Hettinger added the comment:
Letting None be used as an index has always been treated as a feature request;
however, in this case, it can be deemed a bug because the error message is
making a promise that isn't kept.
It would be nice if once and for all this got solved by m
Changes by Raymond Hettinger :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11747>
___
___
Python-bugs-
Raymond Hettinger added the comment:
If you disassemble a function, you typically want to see all the code in that
function. This isn't like pdb where you're choosing to step over or into
another function outside the one be
Raymond Hettinger added the comment:
Re-opening. There are some problems with the fix. Context diff ranges need to
show the ending line number, not the length. Also for unified diffs, GNU diff
is showing (x,0) as just (x).
--
priority: low -> high
resolution: fixed ->
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11830>
___
___
Python-bugs-list mai
Changes by Raymond Hettinger :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11830>
___
___
Python-bugs-
Raymond Hettinger added the comment:
+0 on forward porting
--
assignee: rhettinger -> belopolsky
___
Python tracker
<http://bugs.python.org/issue11830>
___
_
Changes by Raymond Hettinger :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11747>
___
___
Python-bugs-
Raymond Hettinger added the comment:
IMO these are a waste of time and add zero value. Also, the English
hyphenation conventions vary depending on who you ask and they vary over time.
--
nosy: +rhettinger
___
Python tracker
<h
Raymond Hettinger added the comment:
I've long since lost interest in this.
If anyone wants to push it forward,
feel free to re-open.
--
resolution: -> out of date
status: open -> closed
___
Python tracker
<http://bugs.python
Changes by Raymond Hettinger :
--
resolution: -> fixed
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Raymond Hettinger :
--
resolution: -> wont fix
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11806>
___
___
Python-bugs-
Raymond Hettinger added the comment:
Looks good. Please apply.
--
assignee: -> belopolsky
resolution: -> accepted
title: disassembly needs to argument counts on calls with keyword args ->
disassembly needs argument counts on calls with keyword args
type: feature request -&
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
___
Python tracker
<http://bugs.python.org/issue11822>
___
___
Python-bugs-list mailing list
Un
Changes by Raymond Hettinger :
--
assignee: kbk -> rhettinger
keywords: +needs review -patch
versions: +Python 3.3 -Python 3.2
___
Python tracker
<http://bugs.python.org/issue1
Raymond Hettinger added the comment:
Maciek, I added the compatability code to the Python version as requested. Now
the tests pass for both versions. There is still work to be done to
automatically run both versions against the test suite
Raymond Hettinger added the comment:
We should remove the documentation entries that discuss non-guaranteed
implementation details (i.e. which integers are singletons).
Instead, there should probably be a brief tutorial entry on what aspects of
object identity people can rely on:
* None
Changes by Raymond Hettinger :
--
assignee: docs@python -> georg.brandl
nosy: +georg.brandl
___
Python tracker
<http://bugs.python.org/issue11710>
___
___
Py
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11854>
___
___
Python-bugs-list mai
Raymond Hettinger added the comment:
2.6 is closed for anything except security patches at this point.
2.7 is only open for flat-out bugs, not API changes. So, we might be able to
add code that could call the __init__ method (if it exists) whenever a new set
is created, but we couldn
Raymond Hettinger added the comment:
If some code were added to call __init__ for the new instance of a
set/frozenset subclass, it would have to make an assumption that the method's
signature allowed it to be called without any argu
Raymond Hettinger added the comment:
I'm not sure that we really care about handling NotImplemented (practicality
beats purity). At some point, if someone writing a class wants complete
control over the rich comparison methods, then they're going to have to write
tho
Raymond Hettinger added the comment:
It may seem pointless, but it takes less than a minute to do it and it would be
both faster and clearer to do it manually. There's a limit to how much
implicit code generation can or should be done automatically.
Also, I'm not too keen on t
Raymond Hettinger added the comment:
> I am curious, however, as to how this could break existing code.
> It seems like code that relies on a stack overflow is already
> broken as it is.
Probably so. I worry about changes in semantics but it might be
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11875>
___
___
Python-bugs-list mai
Raymond Hettinger added the comment:
To avoid hardcoding the mangled names:
@@ -155,10 +155,9 @@
def __reduce__(self):
'Return state information for pickling'
items = [[k, self[k]] for k in self]
-tmp = self.__map, self.__root, self.__hardroot
-
Raymond Hettinger added the comment:
Uncle Timmy, was this the right thing to do?
--
assignee: mark.dickinson -> tim_one
nosy: +rhettinger, tim_one
___
Python tracker
<http://bugs.python.org/issu
Raymond Hettinger added the comment:
Sorry, this has come up before and was rejected.
--
nosy: +rhettinger
resolution: -> rejected
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
Mario, I removed the unnecessary mutation, but remember that OrderedDict's are
not thread-safe in general. Anything that updates an OrderedDict will
temporarily leave it in an inconsistent state while the links and mappings are
being updated.
Raymond Hettinger added the comment:
What did you have in mind for the operator module?
--
___
Python tracker
<http://bugs.python.org/issue11881>
___
___
Pytho
Raymond Hettinger added the comment:
> operator.getitem could be extended to accept default value
That would be relatively harmless. And because it isn't type specific to
lists, it would be applicable to other types that might better use cases than
lists do.
If you want to pur
Raymond Hettinger added the comment:
Mario, thanks for the bug report.
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11875>
___
_
New submission from Raymond Hettinger :
The three most popular logarithm bases are 10, e, and 2. The math library has
direct function calls for the first two but not the latter which is important
in informatics.
Since a direct call can use a custom algorithm or native hardware support (such
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
components: +Documentation -None
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issu
Raymond Hettinger added the comment:
Detecting _fields is the simplest thing we can do right now. There are too
many structseq API differences to warrant bringing them under a single ABC
umbrella.
--
dependencies: -Enhance Object/structseq.c to match namedtuple and tuple
Changes by Raymond Hettinger :
--
title: Concrete object C API needs abstract path for subclasses of builtin
types -> Concrete object C API considered harmful to subclasses of builtin types
___
Python tracker
<http://bugs.python.org/issu
Raymond Hettinger added the comment:
> Memory is not an issue like it was back in 1991 when
> this range was originally implemented, so we can go
> higher and get a bigger performance boost.
Please don't do this. Memory is still important to a lot of people. Also,
there is
Raymond Hettinger added the comment:
+1
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11901>
___
___
Python-bugs-list mailing list
Unsub
Changes by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11908>
___
___
Python-
Raymond Hettinger added the comment:
I've got it from here. Thanks.
--
___
Python tracker
<http://bugs.python.org/issue11889>
___
___
Python-bugs-list m
Raymond Hettinger added the comment:
I've got from here. Thanks.
--
___
Python tracker
<http://bugs.python.org/issue11908>
___
___
Python-bugs-list m
Raymond Hettinger added the comment:
IMO, this is a complete waste of time and much of the code doesn't actually
read any better afterwards. Some of the mathematical expressions look worse.
There may be some merit to splitting the imports but that isn't worth much
either, perhaps
Changes by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
___
Python tracker
<http://bugs.python.org/issue11929>
___
___
Python-bugs-list mai
Raymond Hettinger added the comment:
> foo(x=default) vs. foo(x = default)
That's fine. Most of the rest of it isn't.
--
___
Python tracker
<http://bugs.pytho
Raymond Hettinger added the comment:
I put a few of these in (ones where it looked like readability was improved).
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Raymond Hettinger :
--
nosy: +rhettinger
priority: normal -> high
___
Python tracker
<http://bugs.python.org/issue9614>
___
___
Python-bugs-list mai
Raymond Hettinger added the comment:
The section heads should remain in title case.
The colon in the octal escape section should remain, but the "If" following it
should be lower cased.
"Phonebook" should remain a single word.
"vs" is fine without the period i
Changes by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
priority: normal -> low
___
Python tracker
<http://bugs.python.org/issue11931>
___
___
Raymond Hettinger added the comment:
I'll do these fix-ups but wish you would shift your focus to making substantive
changes. You're wasting developer time.
--
___
Python tracker
<http://bugs.python.o
Raymond Hettinger added the comment:
This looks good. Thanks for the patch.
--
assignee: docs@python -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issu
Changes by Raymond Hettinger :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11940>
___
___
Python-bugs-
Changes by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11945>
___
___
Python-
Raymond Hettinger added the comment:
It would be better to drop the introductory phrase entirely.
--
nosy: +rhettinger
priority: normal -> low
___
Python tracker
<http://bugs.python.org/issu
Changes by Raymond Hettinger :
--
components: +Interpreter Core
nosy: +rhettinger
type: -> feature request
___
Python tracker
<http://bugs.python.org/issu
Raymond Hettinger added the comment:
Wow Mark, that is really nice work. Thanks.
--
___
Python tracker
<http://bugs.python.org/issue11888>
___
___
Python-bug
Raymond Hettinger added the comment:
A hint that the idea would be useful is that there is an FPU instruction,
FSCALE, devoted to this. However, a hint that this isn't needed is that
Fortran and MATLAB don't have it.
--
___
Python trac
Changes by Raymond Hettinger :
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11983>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Raymond Hettinger :
--
priority: normal -> high
___
Python tracker
<http://bugs.python.org/issue11982>
___
___
Python-bugs-list mailing list
Un
Raymond Hettinger added the comment:
Undefined ordering means just that.
--
nosy: +rhettinger
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
Alexander, I urge you to take a good deal of care with this tracker item and
not make any changes lightly. Take a look at how other languages have dealt
with the issue.
Also, consider that "unorderable" may not be the right answer at all.
Raymond Hettinger added the comment:
Also, if you're going to make a change, please consult the scipy/numpy
community. They are the most knowledgeable on the subject and the most
affected by any change.
Given that they have not made any feature requests or bug reports about the
cu
Raymond Hettinger added the comment:
The report is invalid because min/max make no guarantees about values without a
total ordering.
Your other tracker item correctly focused on the behavior of float('NaN')
itself, rather than on the behavior of everything else in the Python
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11987>
___
___
Python-bugs-list mai
Raymond Hettinger added the comment:
> This line should be protected by acquiring the all_tasks_done lock.
All of three of the condition variables share the same underlying lock. The
increment occurs only with the lock has been acquired.
> Theoretically, the increment could occur som
Changes by Raymond Hettinger :
--
resolution: -> accepted
___
Python tracker
<http://bugs.python.org/issue11982>
___
___
Python-bugs-list mailing list
Un
Changes by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11988>
___
___
Python-
Changes by Raymond Hettinger :
--
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11987>
___
___
Python-bugs-
801 - 900 of 9609 matches
Mail list logo