[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +14227 pull_request: https://github.com/python/cpython/pull/14414 ___ Python tracker <https://bugs.python.org/issue37

[issue37420] os.sched_setaffinity does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +14226 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14414 ___ Python tracker <https://bugs.python.org/issu

[issue37420] os.sched_setaffinity does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher
New submission from Brandt Bucher : This is related to bpo-37417: os.sched_setaffinity doesn't properly handle errors that arise during iteration of the mask argument: Python 3.9.0a0 (heads/master:d52a83a, Jun 26 2019, 15:13:41) [GCC 5.4.0 20160609] on linux Type "help",

[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher
New submission from Brandt Bucher : bytearray.extend doesn't properly handle errors that arise during iteration of the argument: Python 3.9.0a0 (heads/master:5150d32, Jun 26 2019, 10:55:32) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or

[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +14219 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14407 ___ Python tracker <https://bugs.python.org/issu

[issue36229] Avoid unnecessary copies for list, set, and bytearray ops.

2019-03-13 Thread Brandt Bucher
Change by Brandt Bucher : -- title: Linear-time list, set, and bytearray ops. -> Avoid unnecessary copies for list, set, and bytearray ops. ___ Python tracker <https://bugs.python.org/issu

[issue36229] Linear-time list, set, and bytearray ops.

2019-03-13 Thread Brandt Bucher
Brandt Bucher added the comment: I apologize - I should have been clearer about what this accomplishes. I'll use list addition as an example, but this works for any binary operation on these containers. If the left operand has a refcount of exactly one, it will simply mutate in-place

[issue36229] Linear-time list, set, and bytearray ops.

2019-03-13 Thread Brandt Bucher
Brandt Bucher added the comment: > ...in a subsequent "+" operation... Sorry, I meant "&|-" here. -- ___ Python tracker <http

[issue36229] Linear-time list, set, and bytearray ops.

2019-03-13 Thread Brandt Bucher
Brandt Bucher added the comment: I'm sorry, Raymond. I didn't mean to imply that this is a problem that needs fixing. I just saw an opportunity for a cheap, effective performance boost for a potentially expensive operation. Thanks for clarifying. And on users "expecting" co

[issue36229] Linear-time list, set, and bytearray ops.

2019-03-12 Thread Brandt Bucher
Brandt Bucher added the comment: Thank for the input, Serhiy. On point (1): It's a valid concern... but I don't think it's necessarily a good enough reason to withhold a simple, yet *significant* performance increase for a common use case. This reminds me of past CPython implementation

[issue36229] Linear-time list, set, and bytearray ops.

2019-03-11 Thread Brandt Bucher
Change by Brandt Bucher : -- title: Linear-time ops for some mutable collections. -> Linear-time list, set, and bytearray ops. ___ Python tracker <https://bugs.python.org/issu

[issue36229] Linear-time ops for some mutable collections.

2019-03-07 Thread Brandt Bucher
New submission from Brandt Bucher : Binary operations on collections are, in general, of quadratic complexity. However, we can sometimes operate in-place if we know that we hold the only reference to the object. This allows us to avoid making many intermediate copies when summing many lists

[issue36229] Linear-time ops for some mutable collections.

2019-03-07 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +12216 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36229> ___ ___ Py

[issue36144] Dictionary addition.

2019-02-27 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +12098 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36144> ___ ___ Py

[issue36144] Dictionary addition.

2019-02-27 Thread Brandt Bucher
New submission from Brandt Bucher : ...as discussed in python-ideas. Semantically: d1 + d2 <-> d3 = d1.copy(); d3.update(d2); d3 d1 += d2 <-> d1.update(d2) Attached is a working implementation with new/fixed tests for consideration. I've also updated collections.UserDict with the

[issue36117] Allow rich comparisons for real-valued complex objects.

2019-02-26 Thread Brandt Bucher
Change by Brandt Bucher : -- type: enhancement -> behavior ___ Python tracker <https://bugs.python.org/issue36117> ___ ___ Python-bugs-list mailing list Un

[issue36117] Allow rich comparisons for real-valued complex objects.

2019-02-26 Thread Brandt Bucher
Brandt Bucher added the comment: > The rules for when things are comparable or not should be kept simple. I think that the sort of user who uses complex numbers for their numerical calculations would still find this behavior "simple", but that may just be me. > We don't want

[issue36117] Allow rich comparisons for real-valued complex objects.

2019-02-26 Thread Brandt Bucher
Brandt Bucher added the comment: I don't really see, though, how comparing complex(42) == float(42) is any less dangerous than complex(42) <= float(42). It seems odd to me, personally, that real-valued complex objects are valid for *some* rich comparisons (but not others) when the m

[issue36117] Allow rich comparisons for real-valued complex objects.

2019-02-26 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +12073 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36117> ___ ___ Py

[issue36117] Allow rich comparisons for real-valued complex objects.

2019-02-26 Thread Brandt Bucher
New submission from Brandt Bucher : Currently, it isn't legal to perform <, >, <=, or >= rich comparisons on any complex objects, even though these operations are mathematically well-defined for real numbers. The attached PR addresses this by defining rich comparisons for

[issue36095] Better NaN sorting.

2019-02-24 Thread Brandt Bucher
Brandt Bucher added the comment: One other idea I had considered was having a new magic method intended to be used for elementwise comparisons such as these (I’m thinking specifically of the old __cmp__/tp_compare). Sorting routines could check for this method on each element, but fall back

[issue36095] Better NaN sorting.

2019-02-23 Thread Brandt Bucher
Brandt Bucher added the comment: Thanks for the feedback. I agree with you on the iffy delegation issue. However, this is problem that I feel deserves a fix... the behavior (silently producing garbage results) is just so un-pythonic. It’s been made clear in other issues that a warning isn’t

[issue36095] Better NaN sorting.

2019-02-23 Thread Brandt Bucher
Brandt Bucher added the comment: As a design decision, I consciously chose "no". However, it would be straightforward to make the change to support float subclasses: #define ISNAN(N) (N->ob_type == _Type && Py_IS_NAN(PyFloat_AsDouble(N))) becomes #define ISNA

[issue36095] Better NaN sorting.

2019-02-23 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +12031 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36095> ___ ___ Py

[issue36095] Better NaN sorting.

2019-02-23 Thread Brandt Bucher
New submission from Brandt Bucher : Sorting sequences containing NaN values produces an incompletely sorted result. Further, because of the complexity of the timsort, this incomplete sort often silently produces unintuitive, unstable-seeming results that are extremely sensitive

[issue35936] Give modulefinder some much-needed updates.

2019-02-12 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +barry, brett.cannon, ncoghlan ___ Python tracker <https://bugs.python.org/issue35936> ___ ___ Python-bugs-list mailin

[issue35936] Give modulefinder some much-needed updates.

2019-02-10 Thread Brandt Bucher
Brandt Bucher added the comment: Alright, I've gotten all of the tests passing for the new importlib-only implementation. I broke these modifications out into a new private function, _find_module, to make it clear that this fix is a simple drop-in replacement for imp.find_module. Let me

[issue20020] "modernize" the modulefinder module

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch, patch pull_requests: +11788, 11789 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue17396] modulefinder fails if module contains syntax error

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +11781, 11782, 11783, 11784 ___ Python tracker <https://bugs.python.org/issue17396> ___ ___ Python-bugs-list mailin

[issue17396] modulefinder fails if module contains syntax error

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +11781, 11782, 11783 ___ Python tracker <https://bugs.python.org/issue17396> ___ ___ Python-bugs-list mailin

[issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +11786 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue25160> ___ ___ Python-

[issue17396] modulefinder fails if module contains syntax error

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +11781, 11782 ___ Python tracker <https://bugs.python.org/issue17396> ___ ___ Python-bugs-list mailing list Unsub

[issue20020] "modernize" the modulefinder module

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +11788 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +11786, 11787 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue25160> ___ ___ Py

[issue35376] modulefinder skips nested modules with same name as top-level bad module

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +11785 ___ Python tracker <https://bugs.python.org/issue35376> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35936] Give modulefinder some much-needed updates.

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +11779 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35936> ___ ___ Py

[issue35936] Give modulefinder some much-needed updates.

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch, patch pull_requests: +11779, 11780 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue17396] modulefinder fails if module contains syntax error

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +11781 ___ Python tracker <https://bugs.python.org/issue17396> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35936] Give modulefinder some much-needed updates.

2019-02-07 Thread Brandt Bucher
New submission from Brandt Bucher : I've written a patch here that includes a few useful fixes. Namely: - It doesn't crash if it encounters a syntax error. (17396) - It doesn't report certain name collisions as bad. (35376) - It doesn't use mutable default arguments in its initializer. - Most

[issue35936] Give modulefinder some much-needed updates.

2019-02-07 Thread Brandt Bucher
Change by Brandt Bucher : -- components: Library (Lib) nosy: brandtbucher priority: normal severity: normal status: open title: Give modulefinder some much-needed updates. type: enhancement versions: Python 3.4 ___ Python tracker <ht

[issue34614] Builtin `abs(Path)` should return `Path.absolute()`.

2018-09-09 Thread Brandt Bucher
Brandt Bucher added the comment: That all makes sense. Thanks for the quick response! -- ___ Python tracker <https://bugs.python.org/issue34614> ___ ___ Pytho

[issue34614] Builtin `abs(Path)` returns `Path.absolute()`.

2018-09-09 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +8581 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34614> ___ ___ Py

[issue34614] Builtin `abs(Path)` returns `Path.absolute()`.

2018-09-09 Thread Brandt Bucher
New submission from Brandt Bucher : This complements the current Path behavior that overrides division operators for path joining, in that it makes manually-constructed paths easier to form and arguably more readable. Before: p = Path("some", "relative", "path&q

<    1   2   3   4   5   6