[issue7944] Use the 'with' statement in conjunction with 'open' throughout test modules

2010-10-13 Thread Raymond Hettinger
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

[issue7944] Use the 'with' statement in conjunction with 'open' throughout test modules

2010-10-13 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: accepted -> ___ Python tracker <http://bugs.python.org/issue7944> ___ ___ Python-bugs-list mailing list Unsubscri

[issue7944] Use the 'with' statement in conjunction with 'open' throughout test modules

2010-10-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: If you're sure that is still the case, this can proceed. -- ___ Python tracker <http://bugs.python.org/issue7944> ___ ___

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

2010-10-14 Thread Raymond Hettinger
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

[issue10110] Queue doesn't recognize it is full after shrinking maxsize

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

[issue5150] IDLE to support reindent.py

2010-10-15 Thread Raymond Hettinger
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

[issue10110] Queue doesn't recognize it is full after shrinking maxsize

2010-10-15 Thread Raymond Hettinger
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

[issue10110] Queue doesn't recognize it is full after shrinking maxsize

2010-10-15 Thread Raymond Hettinger
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

[issue5729] Allows tabs for indenting JSON output

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

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

2010-10-18 Thread Raymond Hettinger
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

[issue10091] ast.literal_eval does not handled new set literals

2010-10-18 Thread Raymond Hettinger
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

[issue10142] Support for SEEK_HOLE/SEEK_DATA

2010-10-18 Thread Raymond Hettinger
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

[issue10142] Support for SEEK_HOLE/SEEK_DATA

2010-10-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Jesús, can you attach a patch (with the appropriate #ifdefs)? -- ___ Python tracker <http://bugs.python.org/issue10

[issue10160] operator.attrgetter slower than lambda after adding dotted names ability

2010-10-20 Thread Raymond Hettinger
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

[issue10178] PEP 378 uses replace where translate may work better

2010-10-23 Thread Raymond Hettinger
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

Re: [issue10199] Move Demo/turtle under Lib/

2010-10-26 Thread Raymond Hettinger
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,

[issue10199] Move Demo/turtle under Lib/

2010-10-26 Thread Raymond Hettinger
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

[issue10221] {}.pop('a') raises non-standard KeyError exception

2010-10-28 Thread Raymond Hettinger
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

[issue10221] {}.pop('a') raises non-standard KeyError exception

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

[issue10221] {}.pop('a') raises non-standard KeyError exception

2010-10-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: accepted -> stage: commit review -> patch review ___ Python tracker <http://bugs.python.org/issue10221> ___ __

[issue6105] json.dumps doesn't respect OrderedDict's iteration order

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

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

2010-10-29 Thread Raymond Hettinger
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

[issue10240] dict.update.__doc__ is misleading

2010-10-29 Thread Raymond Hettinger
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

[issue6105] json.dumps doesn't respect OrderedDict's iteration order

2010-10-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Backported to 2.7 See r85966 -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue10221] {}.pop('a') raises non-standard KeyError exception

2010-10-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: See r85967, r85968 and r85969. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

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

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

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

2010-10-30 Thread Raymond Hettinger
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

[issue10160] operator.attrgetter slower than lambda after adding dotted names ability

2010-10-30 Thread Raymond Hettinger
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

[issue5729] Allows tabs for indenting JSON output

2010-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Updated and applied in r86022. -- resolution: -> accepted status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue10260] Add a threading.Condition.wait_for() method

2010-10-31 Thread Raymond Hettinger
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

[issue9974] tokenizer.untokenize not invariant with line continuations

2010-10-31 Thread Raymond Hettinger
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.

[issue9685] tuples should remember their hash value

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

[issue10110] Queue doesn't recognize it is full after shrinking maxsize

2010-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Applied in r86049. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue10025] random.seed not initialized as advertised

2010-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Removed the inaccurate description. See r86053. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue7447] Sum() doc and behavior mismatch

2010-10-31 Thread Raymond Hettinger
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/

[issue7402] Improve reduce example in doanddont.rst

2010-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r86070, r86071, and r86072. -- ___ Python tracker <http://bugs.python.org/issue7402> ___ ___ Python-bugs-list mailin

[issue7402] Improve reduce example in doanddont.rst

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

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

2010-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed. See r86073. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue9120] Reduce pickle size for an empty set

2010-10-31 Thread Raymond Hettinger
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

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

2010-10-31 Thread Raymond Hettinger
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

[issue10273] Clean-up Unittest API

2010-10-31 Thread Raymond Hettinger
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

[issue10221] {}.pop('a') raises non-standard KeyError exception

2010-11-01 Thread Raymond Hettinger
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

[issue10273] Clean-up Unittest API

2010-11-01 Thread Raymond Hettinger
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

[issue10273] Clean-up Unittest API

2010-11-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: michael.foord -> rhettinger ___ Python tracker <http://bugs.python.org/issue10273> ___ ___ Python-bugs-list mai

[issue10038] json.loads() on str should return unicode, not str

2010-11-02 Thread Raymond Hettinger
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

[issue8488] Docstrings of non-data descriptors "ignored"

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

[issue10273] Clean-up Unittest API

2010-11-02 Thread Raymond Hettinger
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

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Raymond Hettinger
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

[issue10273] Clean-up Unittest API

2010-11-02 Thread Raymond Hettinger
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

[issue10281] Exception raised when an NNTP overview field is absent

2010-11-02 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg120300 ___ Python tracker <http://bugs.python.org/issue10281> ___ ___ Python-bug

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

2010-11-03 Thread Raymond Hettinger
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

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

2010-11-03 Thread Raymond Hettinger
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

[issue10273] Clean-up Unittest API

2010-11-03 Thread Raymond Hettinger
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

[issue10273] Clean-up Unittest API

2010-11-03 Thread Raymond Hettinger
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

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

2010-11-03 Thread Raymond Hettinger
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

[issue10314] Improve JSON encoding with sort_keys=True

2010-11-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue10314> ___ ___ Python-bugs-list mailing list Unsub

[issue10302] Add class-functions to hash many small objects with hashlib

2010-11-04 Thread Raymond Hettinger
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

[issue10317] Add TurtleShell to turtle

2010-11-05 Thread Raymond Hettinger
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

[issue10323] Final state of underlying sequence in islice

2010-11-05 Thread Raymond Hettinger
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

[issue1346238] A constant folding optimization pass for the AST

2010-11-05 Thread Raymond Hettinger
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

[issue10334] Add new reST directive for links to source code

2010-11-05 Thread Raymond Hettinger
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

[issue10273] Clean-up Unittest API

2010-11-06 Thread Raymond Hettinger
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

[issue10357] ** and "mapping" are poorly defined in python docs

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

[issue10356] decimal.py: hash of -1

2010-11-08 Thread Raymond Hettinger
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(-

[issue10357] ** and "mapping" are poorly defined in python docs

2010-11-08 Thread Raymond Hettinger
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

[issue10354] tempfile.template is broken

2010-11-08 Thread Raymond Hettinger
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

[issue7061] Improve turtle module documentation

2010-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: The mini change log is harmless. I would leave it as is. -- ___ Python tracker <http://bugs.python.org/issue7061> ___ ___

[issue9520] Add Patricia Trie high performance container

2010-11-11 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker <http://bugs.python.org/issue9520> ___ ___ Python-bugs-list mailing list Unsubscri

[issue10408] Denser dicts and linear probing

2010-11-13 Thread Raymond Hettinger
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

[issue10408] Denser dicts and linear probing

2010-11-13 Thread Raymond Hettinger
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

[issue10403] Use "member" consistently

2010-11-13 Thread Raymond Hettinger
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

[issue10408] Denser dicts and linear probing

2010-11-13 Thread Raymond Hettinger
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

[issue10410] Is iterable a container type?

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

[issue10410] Is iterable a container type?

2010-11-13 Thread Raymond Hettinger
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

[issue9520] Add Patricia Trie high performance container

2010-11-13 Thread Raymond Hettinger
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

[issue10410] Is iterable a container type?

2010-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Removed the incorrect "container" reference. See r86463. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.py

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Raymond Hettinger
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

[issue11297] Make ChainMap() public in the collections module.

2011-02-23 Thread Raymond Hettinger
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

[issue11297] Make ChainMap() public in the collections module.

2011-02-23 Thread Raymond Hettinger
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

[issue11304] Input/output tutorial - PI is rounded not truncated

2011-02-23 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue11304> ___ ___ Python-

[issue11304] Input/output tutorial - PI is rounded not truncated

2011-02-23 Thread Raymond Hettinger
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

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

2011-02-23 Thread Raymond Hettinger
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

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

2011-02-23 Thread Raymond Hettinger
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

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

2011-02-23 Thread Raymond Hettinger
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

[issue11296] Possible error in What's new in Python 3.2 : duplication of rsplit() mention

2011-02-24 Thread Raymond Hettinger
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: -&

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

2011-02-25 Thread Raymond Hettinger
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

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

2011-02-25 Thread Raymond Hettinger
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

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

2011-02-25 Thread Raymond Hettinger
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

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Raymond Hettinger
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

[issue11297] Make ChainMap() public in the collections module.

2011-02-25 Thread Raymond Hettinger
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

[issue11297] Make ChainMap() public in the collections module.

2011-02-25 Thread Raymond Hettinger
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

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Raymond Hettinger
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

[issue11333] Add empty __slots__ to collections.abc abstract base classes

2011-02-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido? -- assignee: -> gvanrossum nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue11333> ___ ___ Py

[issue11339] annotation for class being defined

2011-02-27 Thread Raymond Hettinger
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

[issue11339] annotation for class being defined

2011-02-27 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg129656 ___ Python tracker <http://bugs.python.org/issue11339> ___ ___ Python-bug

[issue11339] annotation for class being defined

2011-02-27 Thread Raymond Hettinger
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

[issue11339] annotation for class being defined

2011-02-27 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg129657 ___ Python tracker <http://bugs.python.org/issue11339> ___ ___ Python-bug

[issue11339] annotation for class being defined

2011-02-27 Thread Raymond Hettinger
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()._

[issue11339] annotation for class being defined

2011-02-27 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg129659 ___ Python tracker <http://bugs.python.org/issue11339> ___ ___ Python-bug

[issue11339] annotation for class being defined

2011-02-27 Thread Raymond Hettinger
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

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