Raymond Hettinger added the comment:
I'm not sure that this is a worthwhile exercise unless it can be shown for
certain that alternate implementations need this. Otherwise, it just changes
tests in a way that isn't backwards compatible, makes it more difficult to
apply patches cl
Changes by Raymond Hettinger :
--
resolution: accepted ->
___
Python tracker
<http://bugs.python.org/issue7944>
___
___
Python-bugs-list mailing list
Unsubscri
Raymond Hettinger added the comment:
If you're sure that is still the case, this can proceed.
--
___
Python tracker
<http://bugs.python.org/issue7944>
___
___
Raymond Hettinger added the comment:
> To me, this is more a matter of conceptual completeness
> than one of practical utility ...
Nick, you don't seem to be truly sold on the need.
I'm -1 on adding this. It's basically cruft. If
it were published as an ASPN recipe
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
priority: normal -> low
___
Python tracker
<http://bugs.python.org/issue10110>
___
___
Pyth
Raymond Hettinger added the comment:
There's no need to go to python-dev or python-ideas with this one. If someone
wants to figure-out a way to add reindent functionality to IDLE, patches are
welcome.
--
___
Python tracker
Raymond Hettinger added the comment:
I've briefly looked at the patch and it seems reasonable. Will look it in more
detail by 3.2 goes out.
I'm curious about your use case for wanting to change the maxsize of an
existing Queue that is already in use. That seems like a
Raymond Hettinger added the comment:
That won't be necessary. The change from == to <= is innocuous.
There's no need to lock-up maxsize in a read-only property. We're consenting
adults. Besides, it would probably break someone-else's odd use case. I don't
want
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
___
Python tracker
<http://bugs.python.org/issue5729>
___
___
Python-bugs-list mailing list
Unsubscri
Raymond Hettinger added the comment:
My expectation is that Py_hash_t is the same as Py_ssize_t. The goal is to
make hashes match the range of possible table sizes.
--
___
Python tracker
<http://bugs.python.org/issue9
Raymond Hettinger added the comment:
ast.literal_eval's docs:
'The string or node provided may only consist of the following Python literal
structures: strings, numbers, tuples, lists, dicts, booleans, and None.'
--
resolution: out of
Raymond Hettinger added the comment:
Martin, any thoughts on adding a ZFS dependent feature? ISTM this Solaris
feature hasn't taken hold elsewhere and it may be a mistake to immortalize it
in Python.
--
assignee: -> loewis
nosy: +loewis, rh
Raymond Hettinger added the comment:
Jesús, can you attach a patch (with the appropriate #ifdefs)?
--
___
Python tracker
<http://bugs.python.org/issue10
Raymond Hettinger added the comment:
Thanks for noticing this. I wasn't aware that it had slowed down after dotted
name support had been added.
Since it is a mild performance issue, I'm lowering the priority. Will take a
further look when I get the chance. A first look at the p
Raymond Hettinger added the comment:
Sorry, the text needs to stand as-is.
It is supposed to be a hint of what can be done,
nothing more.
The technique of t=x; x=y; y=t is somewhat basic
and has general applicability -- there's nothing
"complex" about it. Also, for short strin
On Oct 26, 2010, at 10:05 AM, Alexander Belopolsky wrote:
>
> Alexander Belopolsky added the comment:
>
> On Tue, Oct 26, 2010 at 12:31 PM, Guido van Rossum
>> Also many people don't expect to find any code in a file named __init__.py
>> (and most of the time I
>> agree with this).
>
> Well,
Raymond Hettinger added the comment:
> I think it a mistake that tkinter.__init__ is huge,
> about as big as the other 13 modules added together.
> It makes it really hard to dive into the code
That is certainly *not* a best practice.
--
nosy: +r
Raymond Hettinger added the comment:
I agree with the OP's request.
d.pop(k) is conceptually equivalent to:
r = d[k]# raises KeyError(k)
del d[k]
return r
The current message was probably borrowed from dict.popitem(). But that is
much different since the dict.pop(k) meth
Changes by Raymond Hettinger :
--
priority: normal -> low
___
Python tracker
<http://bugs.python.org/issue10221>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Raymond Hettinger :
--
resolution: accepted ->
stage: commit review -> patch review
___
Python tracker
<http://bugs.python.org/issue10221>
___
__
Changes by Raymond Hettinger :
--
priority: normal -> high
___
Python tracker
<http://bugs.python.org/issue6105>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from Raymond Hettinger :
class T(unittest.TestCase):
def test_items_equal(self):
# this test fails, but should succeed
a = [{2,4}, {1,2}]
b = a[::-1]
self.assertItemsEqual(a, b)
This method has a fast-path using sorted() and a slow-path that
Raymond Hettinger added the comment:
I'm not sure that we should mention the fast path for dicts. That is an
implementation detail and may not be present in IronPython, PyPy, Jython, etc.
The current version includes:
D.updated(E, **F) --> None. Updated D for dict/iterable E and
Raymond Hettinger added the comment:
Backported to 2.7
See r85966
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/
Raymond Hettinger added the comment:
See r85967, r85968 and r85969.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
nosy: +rhettinger
priority: normal -> low
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
Am discussing this with the OP on IRC and tabling it for a while so we can
better think out the API.
The goal is to let assertEqual(a, b) do straight-comparions of raw bytes, but
to give a nice looking diff (possibly translated with line breaks or
Raymond Hettinger added the comment:
The patch looks fine.
You're overview of the process presented here in the tracker would make a nice
comment in the code.
If Antoine is happy with the latest patch, then it's ready to apply.
--
assignee: rhettinger
Raymond Hettinger added the comment:
Updated and applied in r86022.
--
resolution: -> accepted
status: open -> closed
___
Python tracker
<http://bugs.python.org/
Changes by Raymond Hettinger :
--
title: Add a thrading.Condition.wait_for() method -> Add a
threading.Condition.wait_for() method
___
Python tracker
<http://bugs.python.org/issu
Raymond Hettinger added the comment:
> My patch handles the described situation, albeit a bit poorly ...
Let us know when you've got a cleaned-up patch and have run the round-trip
tests on a broad selection of files.
For your test case, don't feel compelled to use doctest.
Changes by Raymond Hettinger :
--
assignee: rhettinger ->
___
Python tracker
<http://bugs.python.org/issue9685>
___
___
Python-bugs-list mailing list
Unsubscri
Raymond Hettinger added the comment:
Applied in r86049.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
Removed the inaccurate description.
See r86053.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
Fixed in r86066, r86068 and r86069.
--
resolution: -> fixed
status: open -> closed
versions: -Python 2.6
___
Python tracker
<http://bugs.python.org/
Raymond Hettinger added the comment:
Fixed in r86070, r86071, and r86072.
--
___
Python tracker
<http://bugs.python.org/issue7402>
___
___
Python-bugs-list mailin
Changes by Raymond Hettinger :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue7402>
___
___
Python-bugs-
Raymond Hettinger added the comment:
Fixed. See r86073.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/
Raymond Hettinger added the comment:
Have looked at this again and think I don't care what happens to it. The gain
is minimal but it doesn't take much extra core. Like Fred, I'm not sure having
another code path to test and maintain just to save 5 bytes.
Unassigning. If an
Raymond Hettinger added the comment:
I'll fix this in 2.7.
For 3.2, may remove the method entirely (for the reasons discussed on
python-dev).
--
assignee: michael.foord -> rhettinger
___
Python tracker
<http://bugs.python.org
New submission from Raymond Hettinger :
* Dedocument assertSetEqual, assertDictEqual, assertListEqual, and
assertTupleEqual. These are all automatically dispatched from assertEqual.
The user need not call any of these directly. These methods should not have
been exposed in the docs.
* Add
Raymond Hettinger added the comment:
We don't usually test the content of error messages because they are not a
guaranteed behavior.
--
___
Python tracker
<http://bugs.python.org/is
Raymond Hettinger added the comment:
[Antoine]
> I would prefer assertRegex to assertRegexp
That makes sense. It is the name used in other unittest implementations, it
matches what the re module used to be called in Python, and it avoids issues
with camel casing (i.e. Regexp vs Reg
Changes by Raymond Hettinger :
--
assignee: michael.foord -> rhettinger
___
Python tracker
<http://bugs.python.org/issue10273>
___
___
Python-bugs-list mai
Raymond Hettinger added the comment:
To mitigate possible negative impacts from changing the return type, consider
adding a parse_string hook that lets users control the return type:
json.loads(f, parse_int=decimal.Decimal, parse_string=repr)
--
nosy: +rhettinger
Changes by Raymond Hettinger :
--
priority: normal -> low
___
Python tracker
<http://bugs.python.org/issue8488>
___
___
Python-bugs-list mailing list
Unsubscri
Raymond Hettinger added the comment:
After discussion on python-dev, it seems that API lock-in precludes any change
to the package structure. So, the main proposals left are the addition of new
better aliases for some of the functions and changing to the docs so that the
new name is clear
Raymond Hettinger added the comment:
Besides being shorter, the advantages of assertLE are consistent with the rich
comparison method names, no worries about Than, no camel casing ambiguities, no
pluralization or other nmemonic issues (LessThanEqual or LessThanEquals or
LessThanOrEqual or
Raymond Hettinger added the comment:
Besides being shorter, the advantages of assertLE are consistent with the rich
comparison method names, no worries about Than, no camel casing ambiguities, no
pluralization or other nmemonic issues (LessThanEqual or LessThanEquals or
LessThanOrEqual or
Changes by Raymond Hettinger :
--
Removed message: http://bugs.python.org/msg120300
___
Python tracker
<http://bugs.python.org/issue10281>
___
___
Python-bug
Raymond Hettinger added the comment:
Suggestions:
* new name: assertCountEqual(a, b)
or:assertElementCountEqual(a, b)
this name captures the essential service:
- unordered comparison where duplicates matter
- inputs are "elements",
not "items" w
Raymond Hettinger added the comment:
> I'd be inclined to insert a check that falls back
> to the "unorderable_list_difference" approach in
> the case where "expected != sorted(reversed(expected))".
Too fragile and subtle. The method need
Raymond Hettinger added the comment:
> For the regexp methods we should use assertRegexp
assertRegex is better. it matches the name used in other unittest
implementations, there is not confusion with camel casing RegExp vs Regexp, and
it matches the former name of Python's own rege
Raymond Hettinger added the comment:
> assertLess, on the other hand, I often get wrong,
> since it is *not* __lt__ spelled out.
Right. Even Michael gets that one wrong.
Meditate on why Guido created the special method __lt__ instead of
__less_than__.
Regardless of why Guido mad
Raymond Hettinger added the comment:
One nuance, it may be better to implement as:
a_cnt = collections.Counter(iter(a))
b_cnt = collections.Counter(iter(b))
That will bypass the special handling the Counter constructor has if the
argument is a Mapping
Raymond Hettinger added the comment:
+1
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue10314>
___
___
Python-bugs-list mailing list
Unsub
Raymond Hettinger added the comment:
I concur with Overlord Antoine ;-)
The API of "hashfunc *files" looks like something that should be done at the
command line in bash. For the most part, I think users are better-off using
normal Python loops so they can do something with th
Raymond Hettinger added the comment:
It's better as a demo for cmd than as a useful utility for the turtle module.
Also, we want people using turtle to learn Python, not to bypass the language
altogether.
--
assignee: -> rhettinger
resolution: -> rejected
status: ope
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
components: +Documentation -Interpreter Core
priority: normal -> low
versions: -Python 2.7, Python 3.1
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
David, it would be great if an optional AST optimization pass could do
something that we don't already have (perhaps, loop invariant code motion when
python is called with -OO or somesuch). The AST tree makes it possible for the
first time to pr
New submission from Raymond Hettinger :
In a few cases where the pure python source code is a helpful adjunct to the
documentation, I've added some links using the "seealso" directive:
.. seealso::
Latest version of the `ast module Python source code
<http://s
Raymond Hettinger added the comment:
> people who are used to the current spelling
> will have to notice the change, note that one
> name is now deprecated
I haven't proposed any deprecations.
Just add the new names as aliases.
Change the docs list the new names
as primary a
Changes by Raymond Hettinger :
--
assignee: d...@python -> rhettinger
___
Python tracker
<http://bugs.python.org/issue10357>
___
___
Python-bugs-list mai
Raymond Hettinger added the comment:
Good catch Stefan. This is a regression from Py2.6. The behavior for decimal
should match that for int.
IDLE 2.6.2
>>> hash(-1)
-2
>>> (-1).__hash__()
-2
>>> from decimal import *
>>> hash(Decimal(-
Raymond Hettinger added the comment:
> Even if the glossary pointed to collections.html,
> there are far more methods specified there than
> are needed to be **able.
That is an implementation detail and is subject to
change. If someone supplies an argument satisfying
collection
Raymond Hettinger added the comment:
+1 for just deleting it. nothing is lost by deleting code that never worked
in the first place ;-)
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue10
Raymond Hettinger added the comment:
The mini change log is harmless. I would leave it as is.
--
___
Python tracker
<http://bugs.python.org/issue7061>
___
___
Changes by Raymond Hettinger :
--
assignee: -> rhettinger
___
Python tracker
<http://bugs.python.org/issue9520>
___
___
Python-bugs-list mailing list
Unsubscri
Raymond Hettinger added the comment:
My previous experiments along these lines showed it was a dead-end. The number
of probes was the most important factor and beat-out any effort to improve
cache utilization from increased density.
Doing extra work (more probes) in order to improve cache
Raymond Hettinger added the comment:
FWIW, one way to make a dict denser without increasing the number of probes is
to use Brent's Variation of Algorithm D in Knuth. That optimizes the insertion
order to minimize the number of collisions and lets you pack well over
two-thirds full wi
Raymond Hettinger added the comment:
> "Members and methods" should just be "attributes".
+1
That substitution should be made almost everywhere.
Individual slot variable are still called members though
and their type is a member_descriptor. And the C API
still
Raymond Hettinger added the comment:
See Objects/dictnotes.txt for some of the results.
I spent about full month trying to optimize dict
performance either by tuning parameters or using
different algorithms.
There were a couple wins that were not implemented.
1) Allowing users to control
Changes by Raymond Hettinger :
--
assignee: d...@python -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue10410>
___
___
Python-
Raymond Hettinger added the comment:
> "iterable" is described as "A container object
> capable of returning its members one at a time."
That wording is confusing. I'll fix it.
> Likewise, "and objects of any classes you define
> with an __iter
Raymond Hettinger added the comment:
I don't think a Patricia Trie is going to find its way into the code
distribution. It has a better chance as a third-party module listed on PyPI
(much in the same way that people access memcached from Python).
--
resolution: -> rejecte
Raymond Hettinger added the comment:
Removed the incorrect "container" reference.
See r86463.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.py
Raymond Hettinger added the comment:
> As I said, my only intention here is be to document
> (and argparsify/formalize) what is already there.
In a handful of cases, that would be useful; however,
for the most part, these APIs were undocumented for
a reason. Some of the comman
New submission from Raymond Hettinger :
Attaching a documentation patch.
--
assignee: rhettinger
files: chainmap.diff
keywords: patch
messages: 129161
nosy: rhettinger
priority: low
severity: normal
status: open
title: Make ChainMap() public in the collections module.
type: feature
Raymond Hettinger added the comment:
FWIW, the new_child() and parents() part of the API was modeled after contexts
in ANLTR where they are needed to overcome the limitations of Django's push/pop
style which precludes a context from having multiple, independent children at
the same
Changes by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue11304>
___
___
Python-
Raymond Hettinger added the comment:
Fixed in r88356, r88537, and r88538.
Thanks for the report.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
The patch looks great.
Please apply it.
--
assignee: rhettinger -> eli.bendersky
resolution: later -> accepted
___
Python tracker
<http://bugs.python.org/i
Raymond Hettinger added the comment:
Eli doesn't need to post a new patch. I'm sure he will fix any nits in his
commit.
--
___
Python tracker
<http://bugs.python.o
Raymond Hettinger added the comment:
[Éric Araujo]
> +"L.clear() -> None -- remove all items from L");
> It looks like other methods that return None
> just omit the “-> type” part.
These kind of nitty comments really aren't helpful.
It consumes more time to talk
Raymond Hettinger added the comment:
Okay fixed. The rsplit() method was mentioned in both underlying tracker
issues, so it got mentioned twice when once would have been enough :-)
--
assignee: docs@python -> rhettinger
nosy: +rhettinger
priority: normal -> low
resolution: -&
Raymond Hettinger added the comment:
Unless someone raises a controversial and non-trivial issue about adding
clear() and copy() to bytearray, there is no need for a python-dev discussion
on the subject. Just post a patch to the tracker
Raymond Hettinger added the comment:
Georg, what is the issue? Is there some reason that bytearrays should not be
copied or cleared? Is there some reason to prefer the current:
dup = b[:] # copy
del b[:] # clear
--
___
Python tracker
Raymond Hettinger added the comment:
The ABCs are subset of the methods for the concrete APIs. We've avoided the
likes of copy() because it requires knowledge of the constructor's signature --
for example, MutableMapping does not cover copy().
It is okay for Eli to add MutableSequ
Raymond Hettinger added the comment:
What's wrong with Marc's commit? He's using the standard names.
--
nosy: +rhettinger
___
Python tracker
<http://bugs.pyt
Raymond Hettinger added the comment:
Antoine. Thanks. I put in a paragraph re-emphasizing that ChainMap is a view
and that changes in the underlying mappings get reflected in the ChainMap.
Also, the first sentence says that ChainMap groups multiple dicts or other
mappings. So, any
Raymond Hettinger added the comment:
I was thinking of adding a recipes section to show how to extend or override
the class:
class DjangoContext(ChainMap):
def push(self):
self.maps.insert(0, {})
def pop(self):
self.maps.pop(0)
class NestedScope(ChainMap):
'Mut
Raymond Hettinger added the comment:
> If you agree, Raymond, I'll backport the patch.
Yes. That will address Antoine's legitimate concern about making other
backports harder, and it will get all the Python's to use the canonical
spelling.
For other spellings like &qu
Raymond Hettinger added the comment:
Guido?
--
assignee: -> gvanrossum
nosy: +gvanrossum
___
Python tracker
<http://bugs.python.org/issue11333>
___
___
Py
Raymond Hettinger added the comment:
This would be an important fix-up if we could find some way to implement it.
The basic problem is that the class object is defined after the class
definitions have been made, so the target of the Graph reference isn't known
when the method definition
Changes by Raymond Hettinger :
--
Removed message: http://bugs.python.org/msg129656
___
Python tracker
<http://bugs.python.org/issue11339>
___
___
Python-bug
Raymond Hettinger added the comment:
This would be an important fix-up if we could find some way to implement it.
The basic problem is that the class object is defined after the class
definitions have been made, so the target of the Graph reference isn't known
when the method definition
Changes by Raymond Hettinger :
--
Removed message: http://bugs.python.org/msg129657
___
Python tracker
<http://bugs.python.org/issue11339>
___
___
Python-bug
Raymond Hettinger added the comment:
class Prepared(type):
'Preload the class with a reference to itself'
@classmethod
def __prepare__(mcl, name, bases):
return {name: type(name, bases, {})}
def __new__(mcl, name, bases, mapping):
tmpcls = super()._
Changes by Raymond Hettinger :
--
Removed message: http://bugs.python.org/msg129659
___
Python tracker
<http://bugs.python.org/issue11339>
___
___
Python-bug
Raymond Hettinger added the comment:
This would be an important fix-up if we could find some way to implement it.
The basic problem is that the class object is defined after the class
definitions have been made, so the target of the Graph reference isn't known
when the method definition
601 - 700 of 9609 matches
Mail list logo