[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-11 Thread Mark Dickinson
Mark Dickinson added the comment: > I also wonder if there's security implication for servers that process > user-submitted input Yes, the "malicious actor" scenario is another one to consider. But unlike the string hashing attack, I'm not seeing a realistic way fo

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: > We could make this problem go away by making NaN a singleton. That could work, though we'd annoy anyone who cared about preserving NaN payloads and signs in Python. I don't know if such people exist. Currently the sign is accessible throug

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: > signalling NaNs are quietly silenced on my machine I just tested this assertion, and it appears that I was lying: this doesn't seem to be true. I'm almost *sure* it used to be true, and I'm not sure what changed, and when. (FWIW:

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: @Cong Ma: Yes, I'm not worried about performance for the change you're proposing (though as you say, we should benchmark anyway). The performance thoughts were motivated by the idea of making NaN a singleton: adding a check to PyFloat_FromDouble

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: @Victor: How does the fix for #37193 solve this issue? I think I'm missing something. -- ___ Python tracker <https://bugs.python.org/is

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: Re-opening; I believe this issue is still valid. Here's output on a debug build on current master (commit 7591d9455eb37525c832da3d65e1a7b3e6dbf613) on my machine: lovelace:cpython mdickinson$ ./python.exe Python 3.10.0a6+ (remotes/upstream/master:7591d

[issue39316] settrace skips lines when chaining methods without arguments

2021-03-14 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23619 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24859 ___ Python tracker <https://bugs.python.org/issu

[issue39316] settrace skips lines when chaining methods without arguments

2021-03-14 Thread Mark Shannon
Mark Shannon added the comment: New changeset d48848c83e0f3e41b65c8f741f3fb6dbce5b9c29 by Mark Shannon in branch 'master': bpo-39316: Make sure that attribute accesses and stores, including method calls, conform to PEP 626. (GH-24859) https://github.com/python/cpyt

[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-14 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +23620 pull_request: https://github.com/python/cpython/pull/24860 ___ Python tracker <https://bugs.python.org/issue42

[issue43507] Variables in locals scope fails to be printed.

2021-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: I think this is essentially a duplicate of #24800. (Short version, the behaviour is by design, and documented, but there may be scope for clarifying or improving the documentation.) -- nosy: +mark.dickinson

[issue43507] Variables in locals scope fails to be printed.

2021-03-16 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> exec docs should note that the no argument form in a local scope is really the two argument form ___ Python tra

[issue43497] SyntaxWarning for "assertion is always true, perhaps remove parentheses?" does not work with constants

2021-03-16 Thread Mark Shannon
Mark Shannon added the comment: New changeset a8ef4572a6b28bcfc0b10b34fa4204954b9dd761 by tsukasa-au in branch 'master': bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. (GH-24867) https://github.com/python/cpython/commit/a8ef4572a6b28bcfc0b10b34fa4204

[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-16 Thread Mark Shannon
Mark Shannon added the comment: No. We should add it. -- ___ Python tracker <https://bugs.python.org/issue42246> ___ ___ Python-bugs-list mailing list Unsub

[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +23654 pull_request: https://github.com/python/cpython/pull/24892 ___ Python tracker <https://bugs.python.org/issue42

[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: There's a bigger issue here about what characters should be accepted in numeric literals. The Unicode minus sign (U+2212) "−" is also not currently accepted for Fractions or any other built-in numeric type. > but there are other simil

[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: Seems worth noting that Unicode fractions like ⅔ produce a FRACTION SLASH character when normalized: >>> unicodedata.normalize('NFKC', '⅔') '2⁄3' >>> list(map(unicodedata.name, unicodedata.normalize('NFKC&

[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: Related: #6632 -- ___ Python tracker <https://bugs.python.org/issue43520> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-17 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +23665 pull_request: https://github.com/python/cpython/pull/24902 ___ Python tracker <https://bugs.python.org/issue42

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2021-03-17 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue39511> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43531] Turtle module does not work

2021-03-17 Thread Mark Dickinson
Mark Dickinson added the comment: You have a local file named `turtle.py`, which is conflicting with the standard library `turtle` module. Rename your local file to something else, then you'll be able to import the standard library `turtle` module. -- nosy: +mark.dick

[issue43531] Turtle module does not work

2021-03-17 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-17 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue40521> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue42161> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: Carl: can you say more about the problem that motivated this issue? -- ___ Python tracker <https://bugs.python.org/issue43

[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-20 Thread Mark Shannon
Mark Shannon added the comment: Why? Do you have any evidence that the overhead of super() is significant in real programs, or that the proposed change actually speeds up anything beyond your micro-benchmark? -- nosy: +Mark.Shannon ___ Python

[issue43580] A Question about List Slice

2021-03-21 Thread Mark Dickinson
Mark Dickinson added the comment: It's behaving as designed and documented; see the docs here: https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range (and particularly note 3). In your first example, the first `-1` in `x[1:-1:-1]` is interpreted relative to th

[issue43580] A Question about List Slice

2021-03-21 Thread Mark Dickinson
Change by Mark Dickinson : -- components: -Regular Expressions ___ Python tracker <https://bugs.python.org/issue43580> ___ ___ Python-bugs-list mailin

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-21 Thread Mark Dickinson
Mark Dickinson added the comment: Hi Victor, I just noticed the change to dtoa.c in GH-24821. Please could you explain what the benefit of this change was? In general, we need to be very conservative with changes to dtoa.c: it's a complex, fragile, performance-critical piece of code

[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-22 Thread Mark Shannon
Mark Shannon added the comment: Numbers please. What is "non-negligible cost of allocation/initialization" mean as a fraction of runtime? What sort of speed up are you seeing on whole programs? -- ___ Python tracker <https://bu

[issue43602] Include Decimal's in numbers.Real

2021-03-23 Thread Mark Dickinson
Mark Dickinson added the comment: > I assume, the reason is: there is no lossless conversion to float's (and vice > verse). No, I don't think that's the reason (and in fact we _do_ have lossless conversion of floats to Decimal instances). IMO, the reasons are: - it&#

[issue43602] Include Decimal's in numbers.Real

2021-03-23 Thread Mark Dickinson
Mark Dickinson added the comment: > Seems so, for a static typing. But Python is a dynamically typed > language, isn't? I think we're talking at cross purposes. Static and dynamic typing have nothing to do with this. What do you think the result of `1.0 + Decimal(1)` sho

[issue43603] spam

2021-03-23 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> not a bug stage: -> resolved status: open -> closed title: safgf -> spam type: performance -> ___ Python tracker <https://bugs.pyt

[issue26300] "unpacked" bytecode

2021-03-29 Thread Mark Shannon
Mark Shannon added the comment: PEP 511 was rejected. The "peephole" optimizer now operates on the internal IR, not the bytecode. -- nosy: +Mark.Shannon resolution: -> out of date stage: -> resolved status: open -> closed ___

[issue27129] Wordcode, part 2

2021-03-29 Thread Mark Shannon
Mark Shannon added the comment: frame.f_lasti and traceback.tb_lasti are best left as byte offsets. There is no guarantee that we won't go back to variable length instructions. For example, a "LONG_JUMP" instruction which is 4 bytes long and takes a 3 byte offset might well

[issue27129] Wordcode, part 2

2021-03-29 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +23819 pull_request: https://github.com/python/cpython/pull/25069 ___ Python tracker <https://bugs.python.org/issue27

[issue43682] Make function wrapped by staticmethod callable

2021-03-31 Thread Mark Dickinson
Mark Dickinson added the comment: Seems like a duplicate of #20309. -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue43682> ___ ___

[issue43682] Make function wrapped by staticmethod callable

2021-03-31 Thread Mark Shannon
Mark Shannon added the comment: I don't understand what the problem is. _pyio.open is a function not a static method. >>> import _pyio >>> _pyio.open -- nosy: +Mark.Shannon title: Make static methods created by @staticmethod callable -> Make functio

[issue43682] Make static methods created by @staticmethod callable

2021-03-31 Thread Mark Shannon
Mark Shannon added the comment: Isn't the problem that Python functions are (non-overriding) descriptors, but builtin-functions are not descriptors? Changing static methods is not going to fix that. How about adding wrappers to make Python functions behave like builtin functions and

[issue43682] Make static methods created by @staticmethod callable

2021-03-31 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43682> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-03-31 Thread Mark Shannon
New submission from Mark Shannon : Every time we send, or throw, to a generator, the C code in genobject.c needs to check what state the generator is in. This is inefficient and couples the generator code, which should just be a thin wrapper around the interpreter, to the internals of the

[issue42823] Incorrect frame.f_lineno when frame.f_trace is set

2021-03-31 Thread Mark Shannon
Mark Shannon added the comment: Ned, can I close this? -- ___ Python tracker <https://bugs.python.org/issue42823> ___ ___ Python-bugs-list mailing list Unsub

[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-03-31 Thread Mark Shannon
Change by Mark Shannon : -- assignee: -> Mark.Shannon stage: -> needs patch type: -> performance ___ Python tracker <https://bugs.python.or

[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2021-03-31 Thread Mark Shannon
Mark Shannon added the comment: The bytecode instruction set has changed a lot since 3.6, so I think a backport would be impractical. 3.6 is in security fix only mode, so you'd need to take this up with Red Hat. -- ___ Python tracker &

[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-04-01 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23884 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25137 ___ Python tracker <https://bugs.python.org/issu

[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-04-01 Thread Mark Shannon
New submission from Mark Shannon : In the interpreter and compiler, the "fast" locals array and cells array are treated separately. By merging them in the compiler, the interpreter can be simplified a bit. -- assignee: Mark.Shannon components: Interpreter Core messages: 3

[issue27129] Wordcode, part 2

2021-04-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset fcb55c0037baab6f98f91ee38ce84b6f874f034a by Mark Shannon in branch 'master': bpo-27129: Use instruction offsets, not byte offsets, in bytecode and internally. (GH-25069) https://github.com/python/cpyt

[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-04-01 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +23885 pull_request: https://github.com/python/cpython/pull/25138 ___ Python tracker <https://bugs.python.org/issue43

[issue27129] Wordcode, part 2

2021-04-01 Thread Mark Shannon
Mark Shannon added the comment: That assertion is correct, and hasn't changed. Do you have a traceback? The buildbot just shows the assertion message with no context. -- ___ Python tracker <https://bugs.python.org/is

[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-04-02 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23899 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25152 ___ Python tracker <https://bugs.python.org/issu

[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: I'm running into this, too, on Python 3.9.2; in my case it's causing segmentation faults in a wxPython-based application. Those segfaults aren't the fault of the reference cycle, of course; they're a result of wxPython being finicky

[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a cut-down example, at the prompt: Python 3.9.2 (default, Mar 31 2021, 05:47:22) [Clang 11.0.3 (clang-1103.0.32.62)] on darwin Type "help", "copyright", "credits" or "license" for more information. >&

[issue43710] Access violations in C extension modules on Python 3.9.3

2021-04-03 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23907 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25160 ___ Python tracker <https://bugs.python.org/issu

[issue27129] Wordcode, part 2

2021-04-04 Thread Mark Shannon
Mark Shannon added the comment: New changeset c368ce74d2c9bcbf1ec320466819c2d4768252f7 by Dennis Sweeney in branch 'master': bpo-27129: Update magic numbers and bootstrapping for GH-25069 (GH-25172) https://github.com/python/cpython/commit/c368ce74d2c9bcbf1ec320466819c2

[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-04-06 Thread Mark Shannon
Mark Shannon added the comment: New changeset b37181e69209746adc2119c471599a1ea5faa6c8 by Mark Shannon in branch 'master': bpo-43683: Handle generator entry in bytecode (GH-25138) https://github.com/python/cpython/commit/b37181e69209746adc2119c471599a

[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-04-06 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +23961 pull_request: https://github.com/python/cpython/pull/25224 ___ Python tracker <https://bugs.python.org/issue43

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-06 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue43753> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: For any sane design of tagged pointers, `x == y` (in C) will work fine. `is` is not well defined except for a small set of values, so the docs for `Py_Is` would have to so vague as to be worthless, IMO. -- nosy: +Mark.Shannon

[issue40228] Make setting line number in frame more robust.

2021-04-07 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed status: open -> closed ___ Python tracker <https://bugs.python.org/issue40228> ___ ___ Python-bugs-list

[issue39537] Change line number table format

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: PEP 626 fixed this -- ___ Python tracker <https://bugs.python.org/issue39537> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39537] Change line number table format

2021-04-07 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-04-07 Thread Mark Shannon
New submission from Mark Shannon : The DISPATCH() macro has two failings. 1. Its check for tracing involves too much pointer chaser. 2. The logic assumes that computed-gotos is the "fast path" which makes switch dispatch, and therefore Python on Windows unnecess

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-04-07 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23984 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25244 ___ Python tracker <https://bugs.python.org/issu

[issue43495] Missing frame block push in compiler_async_comprehension_generator()

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: New changeset 7a7ba3d343d360a03a34bc3901628f9f40a58307 by tomKPZ in branch 'master': bpo-43495 : Push missing frame block in compile.c (GH-24865) https://github.com/python/cpython/commit/7a7ba3d343d360a03a34bc3901628f9f40a58307 -- nosy: +Ma

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: I implemented it ages ago :) https://github.com/python/cpython/pull/24417 I need to be better at closing issues. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Pytho

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-04-08 Thread Mark Shannon
Mark Shannon added the comment: New changeset 28d28e053db6b69d91c2dfd579207cd8ccbc39e7 by Mark Shannon in branch 'master': bpo-43760: Streamline dispatch sequence for machines without computed gotos. (GH-25244) https://github.com/python/cpyt

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-04-08 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +24013 pull_request: https://github.com/python/cpython/pull/25276 ___ Python tracker <https://bugs.python.org/issue43

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-04-10 Thread Mark Dickinson
Mark Dickinson added the comment: > Why not have hash() return the id() like we do for instances of object? I think that's fine, and IIUC that's what Cong Ma was proposing. It seems like the least invasive potential fix. In principle I find the idea of making NaN a sin

[issue32466] Fix missing test coverage for fractions.Fraction.__new__

2021-04-11 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Sergey! Agreed that this can be closed. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43682] Make static methods created by @staticmethod callable

2021-04-12 Thread Mark Shannon
Mark Shannon added the comment: This is a significant change to the language. There should be a PEP, or at the very least a discussion on Python Dev. There may well be a very good reason why static methods have not been made callable before that you have overlooked. Changing static methods

[issue43682] Make static methods created by @staticmethod callable

2021-04-12 Thread Mark Shannon
Mark Shannon added the comment: Are you asking why breaking backwards compatibility is an issue? Or how it breaks backwards compatibility? pydoc could be changed to produce the proposed output, it doesn't need this change. We don't know what this change will break, but we do know

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-04-13 Thread Mark Shannon
Mark Shannon added the comment: New changeset 9e7b2076fb4380987ad0262c4c0ca900b06475ad by Mark Shannon in branch 'master': bpo-43760: Speed up check for tracing in interpreter dispatch (#25276) https://github.com/python/cpython/commit/9e7b2076fb4380987ad0262c4c0ca9

[issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j

2021-04-13 Thread Mark Dickinson
Mark Dickinson added the comment: FWIW, if you're specifically interested in complex square roots rather than powers in general, I'd recommend using `cmath.sqrt(value)` rather than `value**0.5` - there are fewer intermediate steps involved in computing `cmath.sqrt`, and the retu

[issue3451] Asymptotically faster divmod and str(long)

2021-04-13 Thread Mark Dickinson
Mark Dickinson added the comment: > we have implemented a faster algorithm for divmod for big numbers using > Mark's fast_div.py in PyPy Urk! I hope your implementation included a healthy dose of validation, testing and cleanup. :-) (I have no doubts that it did.) I'd cons

[issue3451] Asymptotically faster divmod and str(long)

2021-04-13 Thread Mark Dickinson
Mark Dickinson added the comment: FWIW, I think we should close this; the same comments as in issue 26256 apply. See msg259408 onwards in that discussion. -- ___ Python tracker <https://bugs.python.org/issue3

[issue3451] Asymptotically faster divmod and str(long)

2021-04-13 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker <https://bugs.python.org/issue3451> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon
New submission from Mark Shannon : Large literals or function calls with many arguments can consume a lot of stack space. This will be a problem for any future work to use a contiguous stack for data and possibly eliminate frame objects for most calls. It is also possible (I haven&#

[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +pablogsal ___ Python tracker <https://bugs.python.org/issue43846> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +24136 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25403 ___ Python tracker <https://bugs.python.org/issu

[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Mark Dickinson
Mark Dickinson added the comment: Duplicate of #28197? -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue43836> ___ ___ Python-bug

[issue43852] [sqlite3] Harden tuple creation

2021-04-15 Thread Mark Dickinson
Mark Dickinson added the comment: Would the code be cleaner if it used PyTuple_Pack? -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue43

[issue43846] Control stack usage in large expressions

2021-04-15 Thread Mark Shannon
Mark Shannon added the comment: New changeset 11e0b295dee235dd6fd66a10d4823b0dcb014dc4 by Mark Shannon in branch 'master': bpo-43846: Use less stack for large literals and calls (GH-25403) https://github.com/python/cpython/commit/11e0b295dee235dd6fd66a10d4823b

[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-04-17 Thread Mark Dickinson
Mark Dickinson added the comment: Thank you for the quick fix! -- ___ Python tracker <https://bugs.python.org/issue42248> ___ ___ Python-bugs-list mailin

[issue43846] Control stack usage in large expressions

2021-04-21 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43846] Control stack usage in large expressions

2021-04-21 Thread Mark Shannon
Mark Shannon added the comment: I've not measured performance, as the sort of large literals it would impact are very rare, and the sort of calls it would change are almost non-existent. I'd be surprised if any performance difference could be reliably detected with our current p

[issue43903] round() produces incorrect results with certain values

2021-04-21 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue43903> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40222] "Zero cost" exception handling

2021-04-21 Thread Mark Shannon
Mark Shannon added the comment: The changes to pyc format aren't user visible so shouldn't matter, but what about the dis output? Consider this program: def f(): try: 1/0 except: return "fail" Currently it compiles to: 2 0 SETUP_FINA

[issue43910] cgi.parse_header does not handle escaping correctly

2021-04-22 Thread Mark Gordon
New submission from Mark Gordon : cgi.parse_header incorrectly handles unescaping of quoted-strings Note that you can find the related RFCs to how HTTP encodes the Content-Type header at https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html and further discussion on how quoted-string is

[issue43910] cgi.parse_header does not handle escaping correctly

2021-04-22 Thread Mark Gordon
Change by Mark Gordon : -- keywords: +patch pull_requests: +24236 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25519 ___ Python tracker <https://bugs.python.org/issu

[issue27763] Add complex case to test_builtin abs()

2021-04-22 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, it looks as though we do have tests of the form that Evelyn describes in test_complex (which also seems like the right place for those tests). Closing here. Thanks Sergey for the ping! -- stage: test needed -> resolved status: open ->

[issue27763] Add complex case to test_builtin abs()

2021-04-22 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> out of date ___ Python tracker <https://bugs.python.org/issue27763> ___ ___ Python-bugs-list mailing list Un

[issue43908] array.array should remain immutable

2021-04-22 Thread Mark Shannon
Mark Shannon added the comment: Adding an extra flag seems like the sensible thing to do for 3.10 Longer term, we should decouple immutability from whether something is a heap type. I don't know why we would care that it is a heap type at all. Which bit of memory it happens to sit in

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-04-22 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Raymond. I'll open something on the NumPy bug tracker, too, since they may want to consider doing something similar for numpy.float64 and friends. -- ___ Python tracker <https://bugs.python.org/is

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-04-22 Thread Mark Dickinson
Mark Dickinson added the comment: Opened https://github.com/numpy/numpy/issues/18833 -- ___ Python tracker <https://bugs.python.org/issue43475> ___ ___ Pytho

[issue32891] Add 'Integer' as synonym for 'Integral' in numbers module.

2021-04-23 Thread Mark Dickinson
Mark Dickinson added the comment: For the record, here's the python-ideas thread: https://mail.python.org/archives/list/python-id...@python.org/thread/AWNTQZ3HHAQ42O2ZHRA3U2US4HGKC2TF/ I'm no longer convinced that this is a good idea. It's the usual difference between &quo

[issue43932] f-string decimal has leading space

2021-04-24 Thread Mark Dickinson
Mark Dickinson added the comment: This is by design, and documented under the "sign" section here: https://docs.python.org/3/library/string.html#format-specification-mini-language The space before ".2f" is an instruction to leave space for a sign, "-" for a

[issue43932] f-string decimal has leading space

2021-04-24 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43940] int casting to float results to a different value in memory

2021-04-26 Thread Mark Dickinson
Mark Dickinson added the comment: There's an implicit float-to-double conversion here (`fp.contents.value` is represented as a Python float, which is backed by a C double). What you're seeing is that converting the single-precision signaling NaN to double precision loses the sig

[issue43940] int casting to float results to a different value in memory

2021-04-26 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> not a bug status: open -> pending ___ Python tracker <https://bugs.python.org/issue43940> ___ ___ Python-bugs-

[issue43940] int casting to float results to a different value in memory

2021-04-26 Thread Mark Dickinson
Mark Dickinson added the comment: > Is there any workaround? Sorry, I can't answer that without knowing what it is you're trying to do - that is, I don't know which part of the behaviour you want a workaround for. But that's getting off topic for this tracker, whi

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-04-26 Thread Mark Shannon
Mark Shannon added the comment: What exactly is the issue here? That the line number is -1, or that is different from 3.9? The `-1` should be `None`. I can fix that, but there is the issue of whether the cleanup code in a with statement should have a line number or not. The traceback for

<    27   28   29   30   31   32   33   34   35   36   >