[issue46780] Allow Fractions to return 1/6 for "0.17", "0.167", "0.1667", etc.

2022-02-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Nor will it achieve world peace. Please watch the tone. It is borderline abusive and dismissive. > we can invoke the attached as best_fraction(Fraction("0.001"), > Fraction("0.0005"), Fraction("0.0015")) to get t

[issue46757] dataclasses should define an empty __post_init__

2022-02-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: -1 * I concur with Eric that this is mostly not needed. Probably 99.95% of dataclass use case don't need this. When it is needed, it is trivial to implement and probably should be explicit rather that implicit. * Vedran is also correct in noting

[issue46812] Thread starvation with threading.Condition

2022-02-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +tim.peters ___ Python tracker <https://bugs.python.org/issue46812> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46813] Allow developer to resize the dictionary

2022-02-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: This idea surfaced once before and Guido shot it down. IIRC the rationale was the exposed implementation details, that would challenging for users to consistently set the size correctly, and that it may not make sense for other implementations. This

[issue46814] Documentation for constructin abstract base classes is misleading

2022-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: To me, this looks like a way too extensive edit jsut to emphasize a corner case that rarely arises in practice. It bends over backwards to force an awkward definition regarding what an ABC really is. A more minimal edit is to just note that

[issue46814] Documentation for constructin abstract base classes is misleading

2022-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: An analogy may help. Release managers must check the list of release blockers and stop if the list is non-empty. If no release blockers were ever filed, the release blockers list is empty, but it still exists and its definition hasn't changed.

[issue46814] Documentation for constructing abstract base classes is misleading

2022-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I’m only -0 on this. It is also perfectly reasonable to say that a class is abstract if and only if there is at least one remaining abstract method. After 15 years though, I’m inclined to say that the status quo wins

[issue46757] dataclasses should define an empty __post_init__

2022-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Note that adding an empty __post_init__ method would be a breaking change. The following prints out 'B' then 'C'. But if class A adds an empty __post_init__, then 'B' never gets printed. The arrangement relies on class A b

[issue46828] math.prod can return integers (contradicts doc)

2022-02-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll add a note that the output type is determined by the input type. -- assignee: docs@python -> rhettinger nosy: +rhettinger priority: normal -> low ___ Python tracker <https://bugs.python.

[issue46622] Add a async variant of lru_cache for coroutines.

2022-02-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: If this goes forward, my strong preference is to have a separate async_lru() function just like the referenced external project. For non-async uses, overloading the current lru_cache makes it confusing to reason about. It becomes harder to describe

[issue46622] Add an async variant of lru_cache for coroutines.

2022-02-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- title: Add a async variant of lru_cache for coroutines. -> Add an async variant of lru_cache for coroutines. ___ Python tracker <https://bugs.python.org/issu

[issue46813] Allow developer to resize the dictionary

2022-02-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm going to close this one. Making a new and previously rejected extension to one of Python's most import APIs requires broad discussion and buy-in. If you really want to push for this, please take it to the python-ideas list. --

[issue46622] Add an async variant of lru_cache for coroutines.

2022-02-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Andrew Svetlov] > A third-party library should either copy all these > implementation details or import a private function from stdlib OrderedDict provides just about everything needed to roll lru cache variants. It simply isn't true this

[issue46852] Remove float.__get_format__() and float.__set_format__()

2022-02-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would not miss these methods. Unless Mark says they are needed, +1 for removal. -- nosy: +mark.dickinson, rhettinger, tim.peters ___ Python tracker <https://bugs.python.org/issue46

[issue12165] [doc] clarify documentation of nonlocal

2022-02-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I think this is more confusing then helpful. I concur. -- ___ Python tracker <https://bugs.python.org/issu

[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: The difference is the FLAG_REF which is set to 128 (0x80). >>> import marshal >>> var_example = [(1,2,3),(4,5,6)] >>> vm = marshal.dumps(var_example) >>> rm = marshal.dumps([(1,2,3),(4,5,6)]) >>> [v ^ r for v,

[issue46925] Replace key if not identical to old key in dict

2022-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Jelle and Methane that we can't do this without breaking code. Also if you don't care about dict order, the work around is easy. Just remove the old key: d.pop(k); d[k] = v -- nosy: +rhettinger resolution: -> r

[issue46925] Document dict behavior when setting equal but not identical key

2022-03-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: The weakref docs in particular should point out the OP's example and highlight the workaround. -- ___ Python tracker <https://bugs.python.org/is

[issue44863] Allow TypedDict to inherit from Generics

2022-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Related issue: https://bugs.python.org/issue43923 -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue44

[issue46941] Bug or plug not removed (The operator "is")

2022-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: The code in the screenshot looks correct. >>> i = 0 >>> i is int False >>> type(i) is int True The code above does not get warning because "int" is a variable. This kind of comparison is always allowed and

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

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

[issue1288] dict.fromkeys - Odd logic when passing second dict.fromkeys as value

2007-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: This isn't a bug. Writing "dict.fromkeys(xrange(1,48),dict.fromkeys(xrange(1,8),0))" results in the inner expression being evaluated just once and then passed to the outer function call as a fully evaluated argument. As a result, the *same

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

2007-11-07 Thread Raymond Hettinger
Changes by Raymond Hettinger: -- resolution: -> fixed status: open -> closed versions: +Python 2.6 -Python 3.0 __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue1417] Weakref not working properly

2007-11-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: It's easier to see what is going on if you print the object ids. The id of self.bla is different than the subsequent c1.bla. The first is freed before the second gets created. -- nosy: +rhettinger __ Tr

[issue1502] itertools should grow chunkify

2007-11-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, this has been proposed and rejected previously. One of the reasons was that the docs already have a C-speed recipe, grouper(), that shows how to do it with padding and it is even simpler to do it without padding using only zip() or izip(). Another

[issue1498] Rename __builtins__ to __root_namespace__?

2007-11-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I find __root__ to be just right. It is not subject misspelling. It is distinct enough to serve as a mental link to a specific concept. The leading and trailing underscores cause just enough typing pain that I wouldn't want anything l

[issue1746088] long.__str__ is quadratic time

2007-11-27 Thread Raymond Hettinger
Changes by Raymond Hettinger: -- assignee: -> rhettinger nosy: +rhettinger versions: +Python 2.6 -Python 2.5 _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue1045] Performance regression in 2.5

2007-11-27 Thread Raymond Hettinger
Changes by Raymond Hettinger: -- assignee: tim_one -> rhettinger nosy: +rhettinger __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1045> __ ___ P

[issue1045] Performance regression in 2.5

2007-11-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll take a look at it next week -- want to think through the various cases. The current setup provides nice speedups when the length_hint is available. Possibly, it may be worthwhile to skip that check when the input is a generator. For the most

[issue1045] Performance regression in 2.5

2007-11-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the 2.4 to 2.5 timing difference came from renaming __len__ to __length_hint__. This was at Guido's request so that the value of bool (iter(obj)) would always be True. The consequence of the change was that we lost the fast slot lookup for __

[issue12959] Add 'ChainMap' to collections.__all__

2011-09-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue12959> ___ ___ Python-bugs-list mailin

[issue12917] Make visiblename and allmethods functions public

2011-09-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue12917> ___ ___ Python-bugs-

[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2011-09-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be best to think about each of the new links individually rather than making blanket changes. The new links need to have relevance and add value to the topic; otherwise, they are just distractions from the more relevant links that had been

[issue12960] threading.Condition is not a class

2011-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: I recommend just closing this. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue12960> ___ ___ Python-bug

[issue12961] itertools: unlabelled balls in boxes

2011-09-17 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> low ___ Python tracker <http://bugs.python.org/issue12961> ___ ___ Python-bugs-list mailing list Unsubscri

[issue13004] pprint: add option to truncate sequences

2011-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: This needs to be part of the overall effort to build a better pprint. See http://bugs.python.org/issue7434 -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issu

[issue12961] itertools: unlabelled balls in boxes

2011-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Any additions would need to be motivated by real world problems. The issue is that adding more generators makes the module harder to learn and remember, so tools are not usually added "for the sake of complet

[issue12961] itertools: unlabelled balls in boxes

2011-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry Phillip, I'm closing this feature request because the benefits would likely be outweighed by the costs (maintenance, learning curve, module complexity, etc). It was not the goal of the module to become a complete combinatorics toolkit; rather

[issue13095] Support for splitting lists/tuples into chunks

2011-10-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: These have been rejected before. There is always a trade-off in adding tools such as this -- it can take more time to learn and remember them than to write a trivial piece of code to do it yourself. Another issue is that people tend to disagree on how

[issue13121] collections.Counter's += copies the entire object

2011-10-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll add the in-place methods including __iadd__, __isub__, __iand__, and __ior__. If speed is your issue, you should continue to use the update() method which will always be faster because it doesn't have a step to strip zeros and negative v

[issue11085] expose _abcoll as collections.abc

2011-10-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker <http://bugs.python.org/issue11085> ___ ___ Python-bugs-list mailing list Un

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Arfrever Frehtes Taifersar Arahesis] > I suggest to have low-level, POSIX-compatible, > (int, int)-based interface in os module and add > high-level, decimal.Decimal-based interface in > shutil module. I agree that this is the cleanest appro

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker <http://bugs.python.org/issue11457> ___ ___ Python-bugs-list mailing list Un

[issue11489] json.dumps not parsable by json.loads (on Linux only)

2011-10-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger priority: high -> normal ___ Python tracker <http://bugs.python.org/issue11489> ___ ___ Pyth

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought: it would be useful to research how nanosecond-resolution timestamps are going to be supported in other languages. -- ___ Python tracker <http://bugs.python.org/issue11

[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: This changes behavior so that hash() gets called twice for the key tuple, resulting in decreased performance. In an earlier version of the lru_cache before the "with lock" was introduced, the try/except form was more atomic. It also worked well

[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Another issue is that I want to keep the related accesses to the OrderedDict inside the "with lock" in order to avoid a race condition between the testing-for-membership step and the retrieve-the-cached-

[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: One possibility is to move the call to user_function() outside of the KeyError exception handler so that user exceptions won't be chained: def wrapper(*args, **kwds): nonlocal hits, misses key = args if kwds: key += kwd_mark +

[issue13177] Avoid chained exceptions in lru_cache

2011-10-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, I'm not going to introduce a possible race condition because you find try/except to be less elegant than an if-contains test. Also, I want to keep the current behavior of calling hash only once. Your original complaint is valid though, so I&

[issue13177] Avoid chained exceptions in lru_cache

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

[issue13177] Avoid chained exceptions in lru_cache

2011-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the bug report and for the test case. -- ___ Python tracker <http://bugs.python.org/issue13177> ___ ___ Python-bug

[issue13185] Why does Python interpreter care about curvy quotes in comments?

2011-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Martin and Ezio. This report was correctly closed as invalid. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13

[issue13203] Doc: say id() is only useful for existing objects

2011-10-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think this is over-explaining an implementation detail and it makes the docs for id() harder to understand. Possibly there can be a FAQ entry about identity but the id() function itself is no place to go into the quirks of when new objects are created

[issue13203] Doc: say id() is only useful for existing objects

2011-10-17 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker <http://bugs.python.org/issue13203> ___ ___ Python-bugs-list mai

[issue13212] json library is decoding/encoding when it should not

2011-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't see any way of changing this without breaking lots of code that currently works fine. It may be possible to add a strict-mode (off by default) or to add warnings. -- nosy: +rhettinger ___ P

[issue13214] Cmd: list available completions from the cmd.Cmd subclass and filter out EOF handler(s)

2011-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks to be a reasonable request. I think the patch would be better if the filtering were done directly in get_names(). A subclass can override or extend that method if it wants to customize the filter. -- assignee: -> rhettinger n

[issue13173] Default values for string.Template

2011-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks like a reasonable use case. That being said, I question whether the defaults should be attached directly to the template instance or whether they should be part of the substitution method. FWIW, there already have a couple of other ways to do

[issue13197] subprocess: move shell arguments to a separate keyword param

2011-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think you can tighten the API at this point. We could however make Popen complain when options are going to be thrown away. Or it could be made more liberal about what is accepts (running shlex on string input or join on list input as n

[issue13152] textwrap: support custom tabsize

2011-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13152> ___ ___ Python-bugs-list mailing list Unsub

[issue13121] collections.Counter's += copies the entire object

2011-10-18 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file23457/counter.diff ___ Python tracker <http://bugs.python.org/issue13121> ___ ___ Python-bugs-list m

[issue13212] json library is decoding/encoding when it should not

2011-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm thinking that we should offer a strict-option (off by default) and leave it at that. No need to break existing code. AFAICT, the OP is the only one to have had problems with this in-practice (the JSON module or its ancestor simplejson has

[issue13121] collections.Counter's += copies the entire object

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

[issue12185] Decimal documentation lists "first" and "second" arguments, should be "self" and "other"

2011-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, I'm going to reject this one. I applied the patch and looked at the generated docs, finding them to be less readable than before. AFAICT, we've had no issues with people mis-reading the text as currently presented. Also, I looked b

[issue11931] Regular expression documentation patch

2011-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Applied many of these changes to 3.2 and 3.3. If someone is interested, feel free to backport them to 2.7. -- resolution: -> fixed status: open -> closed versions: -Python 3.1, Python 3.2, Python 3.3 ___

[issue12668] 3.2 What's New: it's integer->string, not the opposite

2011-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the report. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue13227] Option to make the lru_cache type specific

2011-10-19 Thread Raymond Hettinger
New submission from Raymond Hettinger : Based on a comment from Andrew Koenig, it is suggested that the lru_cache() offer an option to become type specific so that equal objects of different typed don't get cached to the same entry. Here's an example: @lru_cache(typed=True) de

[issue13227] Option to make the lru_cache type specific

2011-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Updated patch to include tests and an application to the re module. -- Added file: http://bugs.python.org/file23475/typed_lru2.diff ___ Python tracker <http://bugs.python.org/issue13

[issue13227] Option to make the lru_cache type specific

2011-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Nick, Ezio, and Victor, thanks for looking at the code. Here's an updated the patch: * optimization for fast globals() are now keyword-only arguments * now types the keyword values, not the key/values tuples * expanded tests * added the doc u

[issue13227] Option to make the lru_cache type specific

2011-10-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Victor, Ezio, and Nick, thanks for the review. Andrew, thanks for the feature request. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue13237] subprocess docs should emphasise convenience functions

2011-10-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13237> ___ ___ Python-bugs-list mailing list Unsub

[issue13212] json library is decoding/encoding when it should not

2011-10-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Assigning back to me (the current maintainer of the module). -- assignee: -> rhettinger ___ Python tracker <http://bugs.python.org/issu

[issue13274] heapq pure python version uses islice without guarding for negative counts

2011-10-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: The behavior is undefined for negative inputs, so implementations are free to the most expedient choices. -- priority: normal -> low ___ Python tracker <http://bugs.python.org/issu

[issue13280] argparse should use the new Formatter class

2011-10-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: There's no reason to switch the implementation. The % formatting isn't going away and we've decided against doing switch-overs in existing code (it risks introducing bugs while conferring zero benefits to users). -- no

[issue13270] all classes are new style

2011-10-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Removed the newstyle/oldstyle comments is fine. I don't see the reason for the type->class change though. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org

[issue13280] argparse should use the new Formatter class

2011-10-29 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> invalid status: open -> closed ___ Python tracker <http://bugs.python.org/issue13280> ___ ___ Python-bugs-

[issue13173] Default values for string.Template

2011-10-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Barry, any thoughts? -- assignee: rhettinger -> barry nosy: +barry ___ Python tracker <http://bugs.python.org/issu

[issue13274] heapq pure python version uses islice without guarding for negative counts

2011-10-29 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> invalid status: open -> closed ___ Python tracker <http://bugs.python.org/issue13274> ___ ___ Python-bugs-

[issue13274] heapq pure python version uses islice without guarding for negative counts

2011-10-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: I went ahead an added the guards to the pure python code. Still disagree with your assertion that non-cpython implementations were somehow broken when an undefined behavior was implemented in a different way -- nsmallest() and nlargest() have no

[issue13299] namedtuple row factory for sqlite3

2011-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13299> ___ ___ Python-bugs-list mailing list Unsub

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Martin. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13279> ___ ___ Python-bugs-list m

[issue13340] list.index does not accept None as start or stop

2011-11-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: The relevant code is in _PyEval_SliceIndex() in Python/ceval.c. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13

[issue13340] list.index does not accept None as start or stop

2011-11-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think this "fix" was too hastily committed. 1) It was an API change. 2) It probably should have been done in _PyEval_SliceIndex(). Be careful. Don't rush to commit. Especially for backports. -- status:

[issue13340] list.index does not accept None as start or stop

2011-11-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: The API in 2.7 shouldn't be changed. The error message can be fixed though. Also, it is not clear that the API should change even in 3.3. The list.index() method is not required to accept None. It is not different than other APIs tha

[issue13355] random.triangular error when low = mode

2011-11-06 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13355> ___ ___ Python-bugs-list mai

[issue13340] list.index does not accept None as start or stop

2011-11-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: > There's still the question whether {list,tuple}.index() should accept None or > not. The API should not be changed for Py2.7 and Py3.2. Those changesets should be reverted. For Py3.3, it is open to discussion, but we probably don't

[issue13340] list.index does not accept None as start or stop

2011-11-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought: the API for list.index() doesn't exist in isolation. There is also str.index, the sequence abstract base class, and tons of code that has been written to emulate lists. This is an ancient API (approx 20 years) and should on

[issue13357] HTMLParser parses attributes incorrectly.

2011-11-06 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> high ___ Python tracker <http://bugs.python.org/issue13357> ___ ___ Python-bugs-list mailing list Un

[issue13362] Many PEP 8 errors

2011-11-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Benjamin. This is a waste of time and a potential source of new errors. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13

[issue13384] Unnecessary __future__ import in random module

2011-11-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: I thought we had a policy that future imports would never be removed. -- nosy: +rhettinger status: closed -> open ___ Python tracker <http://bugs.python.org/issu

[issue13384] Unnecessary __future__ import in random module

2011-11-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: At one point, for 2.x at least, we weren't removing the "from __future__" imports even after the feature became available. -- ___ Python tracker <http://bugs.pyt

[issue13385] Add an explicit re.NOFLAGS flag value to the re module

2011-11-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you for closing this. I think it would only add clutter to a module that is already puts readers into information overload. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue13

[issue12875] backport re.compile flags default value documentation

2011-11-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: This patch looks fine. -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue12875> ___ ___ Python-bugs-list m

[issue13346] re.split() should behave like string.split() for maxsplit=0 and maxsplit=-1

2011-11-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Terry, thanks for closing this. The API for str.split() has been set in stone for a very long time. -- ___ Python tracker <http://bugs.python.org/issue13

[issue13355] random.triangular error when low = high=mode

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've got this one. -- ___ Python tracker <http://bugs.python.org/issue13355> ___ ___ Python-bugs-list mailing list

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker <http://bugs.python.org/issue13396> ___ ___ Python-bugs-list mailing list Un

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: How would this work for other random number generators that don't supply genrand_int32()? The API for random is supposed to be easily subclassable and reusable for other random number generators. The requirements for those generators is intentio

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > genrand_int32 is an internal function, > only available in C for the Mersenne Twister generator. Yes, I know. I'm the one added that code ;-) > I don't know other generators. The problem is that we need an API that will accom

[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Raymond Hettinger
New submission from Raymond Hettinger : Currently, an XMLRPC client communicating with a server running Python can make Python style calls but exceptions get collapsed into a standard FaultException making it difficult to program in a Pythonic style: proxy = xmlrpc.client.ServerProxy("

[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- components: +Library (Lib) priority: normal -> low ___ Python tracker <http://bugs.python.org/issue13397> ___ ___ Python-

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: The differential cost of generating n random bytes is negligible compared to actually doing anything with the bytes once their generated. This optimization is close to being a total waste (saving 15 milliseconds for the abnormal case of generating 1

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