[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: PS. It would be nice to also update Cython, which is the only thing that uses these C APIs. -- ___ Python tracker ___

[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread Guido van Rossum
New submission from Guido van Rossum : This is up for grabs. For reference, the Steering Council approved getting rid of these two C APIs without honoring the customary two-release deprecation period required by PEP 387. For reference see

[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread STINNER Victor
STINNER Victor added the comment: I understood that these function calls shoud be replaced with: * PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno) * code.replace() method: https://docs.python.org/dev/library/types.html#types.CodeType.replace --

[issue20115] NUL bytes in commented lines

2021-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: Which part puzzles you? I see that you tried >>> #\0 This does not contain a null byte, just three characters: a hash, a backslash, and a digit zero. -- ___ Python tracker

[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread Dong-hee Na
Dong-hee Na added the comment: FYI, mypyc is using PyCode_New. mypyc should be fixed not to use PyCode_New :) -- ___ Python tracker ___

[issue20115] NUL bytes in commented lines

2021-09-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: What I missed before is that duplicating the effect of the first two interactive entries (no exception) requires escaping the backslash so that the source argument for the explicit compile does not have a null. compile("'\\0'", '', 'exec') at

[issue44892] [configparser] Module configparser fails when the config file contains a0918076336 "100%" inside a commentary

2021-09-06 Thread Nirawat Puechpian
Change by Nirawat Puechpian : -- assignee: -> terry.reedy components: +Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, SSL, Subinterpreters, Tests, Tkinter, Windows, XML, macOS -Library (Lib) nosy: +koobs, ned.deily, paul.moore, ronaldoussoren, steve.dower,

[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-09-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +26617 pull_request: https://github.com/python/cpython/pull/28190 ___ Python tracker ___

[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread STINNER Victor
STINNER Victor added the comment: If possible, I suggest to do in in this order: * Fix Cython * Publish a Cython release including the fix * (Maybe wait a bit) * Remove the two functions Previously, we tried to first modified Python, and then update Cython: it went bad. Otherwise, the

[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-09-06 Thread STINNER Victor
STINNER Victor added the comment: bench.py: pyperf benchmarks on BaseException_dealloc(). Benchmarks results on PR 28190 on Fedora 34 with LTO (I didn't use PGO nor CPU pinning). It says "faster" but it's likely noise in the build or in the benchmark (again, I didn't use CPU pinning, and I

[issue20115] NUL bytes in commented lines

2021-09-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: The compile() doc currently says ""This function raises SyntaxError if the compiled source is invalid, and ValueError if the source contains null bytes." And indeed, in repository 3.9, 3.10, 3.11, >>> compile('\0','','exec') Traceback (most recent call

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
I actually like it if a language lets you spell out your intention, although adding many keywords is not a plus. So, yes something like: loop ... end loop; Is appealing as it makes clear the decision on when to exit the loop must be within the loop (or till

[issue45121] Regression in 3.9.7 with typing.Protocol

2021-09-06 Thread Shantanu
Shantanu added the comment: Sorry if my message was confusing. Hopefully the following makes things clear: 3.9.6: snippet runs without error 3.9.7, with bpo-44806: (a probably reasonable) TypeError, but a breaking change main, with bpo-45081: RecursionError --

[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45121] Regression in 3.9.7 with typing.Protocol

2021-09-06 Thread Shantanu
New submission from Shantanu : Consider: ``` from typing import Protocol class P(Protocol): ... class C(P): def __init__(self): super().__init__() C() ``` This code passes without error on 3.9.6. With 3.9.7, we get: ``` Traceback (most recent call last): File

[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: That sounds like a good plan (note that alpha 1 will go out around Oct 4). I left an issue for Cython: https://github.com/cython/cython/issues/4365 -- ___ Python tracker

Re: on floating-point numbers

2021-09-06 Thread Hope Rouselle
Chris Angelico writes: > On Sun, Sep 5, 2021 at 1:04 PM Hope Rouselle wrote: >> The same question in other words --- what's a trivial way for the REPL >> to show me such cycles occur? >> >> >> 7.23.as_integer_ratio() >> >>> (2035064081618043, 281474976710656) >> >> Here's what I did on this

Re: on writing a while loop for rolling two dice

2021-09-06 Thread 2QdxY4RzWzUUiLuE
On 2021-09-06 at 20:11:41 -0400, Avi Gross via Python-list wrote: > And in the python version, has anyone made a generator that returned > NULL or the like so you can say uselessly: > > for ( _ in forever() ) ... while "forever": ... --

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
I hate to quibble but as almost anything in Python can evaluate to being truthy, a command like while "never" evaluates to true as the string is not empty. I meant a generator like >>> def boring(): while True: yield() >>> for _ in boring(): print("repeating ...")

[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread Dong-hee Na
Change by Dong-hee Na : -- Removed message: https://bugs.python.org/msg401202 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread Dong-hee Na
Dong-hee Na added the comment: I sent the patch for this issue: https://github.com/python/mypy/pull/11067 -- nosy: +corona10 ___ Python tracker ___

[issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs

2021-09-06 Thread Dong-hee Na
Dong-hee Na added the comment: I sent the patch for this issue: https://github.com/python/mypy/pull/11067 -- ___ Python tracker ___

Non sequitur: on writing a while loop for rolling two dice

2021-09-06 Thread Dennis Lee Bieber
RESEND with clarification! On Mon, 6 Sep 2021 20:11:41 -0400, Avi Gross via Python-list declaimed the following: >changing. Ages ago we had code that processed MTA headers and every time we >had a meeting of standards bodies, we kept adding ever more headers and Why did my mind

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
It has been nearly three decades since I have had to write in C, Stefan, but what I suggested jokingly is quite mild compared to what the winners of the obfuscated C Contest do: https://www.ioccc.org/ Time for me to drop out of this thread. Personally I fully agree uses of "while' as described

[issue45116] Performance regression 3.10b1 and later on Windows

2021-09-06 Thread STINNER Victor
STINNER Victor added the comment: > Since PR25244 (28d28e053db6b69d91c2dfd579207cd8ccbc39e7), _PyEval_EvalFrameDefault() in ceval.c has seemed to be unoptimized with PGO (msvc14.29.16.10). > At least the functions below have become un-inlined there at all. I'm not sure if PGO builds are

[issue45121] Regression in 3.9.7 with typing.Protocol

2021-09-06 Thread Shantanu
Change by Shantanu : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45121] Regression in 3.9.7 with typing.Protocol

2021-09-06 Thread Eric V. Smith
Eric V. Smith added the comment: Possibly related to issue 45081, which ended up not having anything to do with dataclasses (despite the title). Can you check if that fix solves your problem? -- nosy: +eric.smith ___ Python tracker

[issue45104] Error in __new__ docs

2021-09-06 Thread Vedran Čačić
Vedran Čačić added the comment: The first variant seems best to me. -- nosy: +veky ___ Python tracker ___ ___ Python-bugs-list

[issue45121] Regression in 3.9.7 with typing.Protocol

2021-09-06 Thread Shantanu
Shantanu added the comment: As I mentioned in the post, bpo-45081 actually makes this issue worse, since we get a RecursionError. I think `TypeError: Protocols cannot be instantiated` is probably okay behaviour (as opposed to RecursionError), more just unfortunate that it seems to be an

Non sequitur: on writing a while loop for rolling two dice

2021-09-06 Thread Dennis Lee Bieber
On Mon, 6 Sep 2021 20:11:41 -0400, Avi Gross via Python-list declaimed the following: >changing. Ages ago we had code that processed MTA headers and every time we >had a meeting of standards bodies, we kept adding ever more headers and Why did my mind immediately flash on "The Man Who

[issue45117] `dict` not subscriptable despite using `__future__` typing annotations

2021-09-06 Thread Dennis Sweeney
Dennis Sweeney added the comment: Hi Stefan, `from __future__ import annotations` only affects annotations -- just the things after the colon. It makes it so that annotations are never evaluated, so things like this work: >>> from __future__ import annotations >>> x:

[issue20115] NUL bytes in commented lines

2021-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: Serhiy’s comment from 2014-01-04 gives the answer. It’s different reading from a file than from a string. And only “python x.py” still reads from a file. -- ___ Python tracker

[issue44892] [configparser] Module configparser fails when the config file contains a "%" inside a commentary

2021-09-06 Thread Kubilay Kocak
Change by Kubilay Kocak : -- assignee: terry.reedy -> components: +Library (Lib) -Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, SSL, Subinterpreters, Tests, Tkinter, Windows, XML, macOS nosy: +lukasz.langa -koobs, ned.deily, paul.moore, ronaldoussoren,

[issue44892] Configparser fails when the .cfg file contains comments

2021-09-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: Make PR branch from main, which I used for testing. I verified issue on 3.10 and 3.9, so we will backport. -- stage: needs patch -> test needed title: Configparser fails when the file contains $ inside a comment -> Configparser fails when the .cfg

[issue45123] PyAiter_Check & PyObject_GetAiter issues

2021-09-06 Thread Yury Selivanov
New submission from Yury Selivanov : Per discussion on python-dev (also see the linked email), PyAiter_Check should only check for `__anext__` existence (and not for `__aiter__`) to be consistent with `Py_IterCheck`. While there, I'd like to rename PyAiter_Check to PyAIter_Check and

[issue45123] PyAiter_Check & PyObject_GetAiter issues

2021-09-06 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +26618 pull_request: https://github.com/python/cpython/pull/28194 ___ Python tracker ___

[issue44892] Configparser fails when the file contains $ inside a comment

2021-09-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: Diego, I repaired the defacement, which included removing you as nosy. Relevant doc: https://docs.python.org/3/library/configparser.html#configparser.BasicInterpolation To me, the following line implies that % may be used freely in comments. gain: 80%% #

<    1   2