forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
- Add new
tp_reachable(same signature astp_traverse) toPyTypeObject(Needed for the PEP not PLDI) - Split
immutablemodule into a Python module and a C module - Add
@freezable,@frozen,@explicitlyFreezableand@unfreezabledecorator - Add
set_freezable()with the valuesYES,NO,EXPLICITandPROXY(For modules) to theimmutablemodule- Implement the
Explicitfreezability - Check for freezability in freezing code
- Implement the
- Allow
freeze()to take multiple arguments - Make
freeze()return the (first) passed in object - Remove old code from the
immutablemodule, for exampleimmutable_register_freezable - Add
ImmutableErrorto the immutable module (Error name and message is open to change) - Modules & Types should be unfreezable by default
- PLDI specific: Modules should have the
Proxyimmutability by default or different default should be documented - Investigate if
_PyOwnership_is_c_wrapperis still needed
- PLDI specific: Modules should have the
- Make
shadow_function_globalsless smart (Don't freeze values based on strings which might index) - Add escape hatches (§6.2):
- Sub-interpreter Local
- Cell type
- Add
mutable(obj, ...)context manager to temporarily setfreezabilitytoNo- Maybe add a C mechanism which could be used in a similar way
- Investigate naming convention, should
isfrozenbeis_frozen?- Either adjust paper (which uses
is_frozen) - Or our implementation which uses
isfrozen
- Either adjust paper (which uses
- Support immutability by construction (§5.3 in the paper)
- Add
register_shallow_freezable(𝑡𝑦𝑝𝑒) - Make these objects immutable on first observation
- Add
- Some test were failing for module objects in proxy mode
- Expose mutable module state in
sys.mut_modules - Add pre-freeze hook (and check for it)
- Change module and functions to use the pre-freeze hook instead of
if-statement
- Change module and functions to use the pre-freeze hook instead of
Pending TODOs, but not critical for PLDI or DPO:
- Improve RC overhead for frozen objects
Metadata
Metadata
Assignees
Labels
No labels