neonene

Results 36 comments of neonene

The commit 2e59344a90a65c65ec6bba43a79ed5138d0da427 added repeat functions to compare the performance with `PyType_GetModuleByDef()`. **Find superclass A:** ```py from timeit import timeit setup = f"""if 1: import _testcapi A = _testcapi.create_type_with_token("_testcapi.A", 0)...

Tested the performance again, which now takes into account the overhead of `PyLong_AsVoidPtr()`: 7735ef1fe2fa5f94215dbb6a56ccd1a4be5b0f9d[^1]. script (expand) ```py from timeit import timeit setup = """if 1: import _testcapi A = _testcapi.create_type_with_token("_testcapi.A",...

> I haven't tested this with that patch yet, but even if it doesn't help, #116458 does resolve use-after-free of almost all ctypes-related interned strings. Also, please consider making the...

If `httpx` tries to import `datetime` lazily at `BoundSyncStream.close()`, an `ImportError` occurs even on 3.11: https://github.com/python/cpython/blob/281fc338fdf57ef119e213bf1b2c772261c359c1/Lib/importlib/_bootstrap.py#L1246-L1248 The same error can happen in the current `_datetimemodule.c` even before `module_clear()` is invoked,...

I've posted my questions, keeping aside the `_datetime`. I'm not sure yet what need to be fixed. https://discuss.python.org/t/strange-side-effect-of-the-generator-when-finally-clause-is-contained/88353

Generator's different behaviors are still surprising to me: ```py def gen(): try: print(1) yield 2 finally: print(3) ``` * `print(next(it := gen()))` ``` 1 2 3 ``` * `print(next(gen()))` ```...