GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — gh-149171: Make TypeAliasType __module__ writable by ericmarkmartin · Pull Request #149172 · python/cpython Conversation
|
| PyObject *old_module = ta->module; | ||
| Py_XDECREF(old_module); | ||
| ta->module = Py_XNewRef(value); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Use Py_XSETREF instead. More generally, making it writable looks like we may introduce races on the free-threaded build so I think the getter/setter will need a critical section. I however don't know whether this should be considered an atomic change or not.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Documentation build overview
15 files changed ·
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| { | ||
| typealiasobject *ta = typealiasobject_CAST(self); | ||
| Py_BEGIN_CRITICAL_SECTION(self); | ||
| Py_XSETREF(ta->module, Py_XNewRef(value)); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Minor but we could move the DECREF on the old value outside the critical section. This could theoretically cause issues if the old value has a very expensive destructor.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
c506040 to
eaff263
Compare
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
c0eeb1f to
aa41fd5
Compare
|
CI failures appear to be due to the Canonical outage. I hope to get this in before the beta though. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…0852 https://build.opensuse.org/request/show/1370852 by user dgarcia + anag_factory - Drop not needed patch py314-fix-tests.patch - Add upstream patch remove-obsolete-literal-deduplication-assertion.patch (gh#python/typing_extensions#785, bsc#1274786) - Update to 4.16.0: * Avoid a DeprecationWarning when deprecated is applied to a coroutine function on Python 3.14.0. * Make `typing_extensions.TypeAliasType`'s `__module__` attribute writable. Backport of CPython PR [#149172](python/cpython#149172). * Fix setting of `__required_keys__` and `__optional_keys__` when inheriting keys with the same name. * Add support for `AsyncIterator`, `io.Reader`, `io.Writer` and `os.PathLike` protocols as bases for other protocols. * Fix incorrect behaviour on Python 3.9 and Python 3.10 that meant that calling `isinstance` with `
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Make TypeAliasType __module__ attribute writable
There was an error while loading. Please reload this page.