Skip to content

PEP: Deep Immutability for Python#8

Merged
TobiasWrigstad merged 27 commits intomainfrom
pep-changes
May 14, 2025
Merged

PEP: Deep Immutability for Python#8
TobiasWrigstad merged 27 commits intomainfrom
pep-changes

Conversation

@TobiasWrigstad
Copy link
Copy Markdown
Owner

No description provided.

* Tagged a bunch of things as TODO
* Updated some parts according to discussions with Faster CPython team
TobiasWrigstad and others added 4 commits April 25, 2025 13:38
PEP: 9999
Title: Deep Immutability in Python
Author: Matthew Johnson <matjoh@microsoft.com>, Matthew Parkinson <mattpark@microsoft.com>, Sylvan Clebsch <sylvan.clebsch@microsoft.com>, Fridtjof Peer Stoldt <fridtjof.stoldt@it.uu.se>, Tobias Wrigstad <tobias.wrigstad@it.uu.se>
Sponsor: TBD
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who should be our sponsor? Does that happen now or later?

Title: Deep Immutability in Python
Author: Matthew Johnson <matjoh@microsoft.com>, Matthew Parkinson <mattpark@microsoft.com>, Sylvan Clebsch <sylvan.clebsch@microsoft.com>, Fridtjof Peer Stoldt <fridtjof.stoldt@it.uu.se>, Tobias Wrigstad <tobias.wrigstad@it.uu.se>
Sponsor: TBD
Discussions-To: TBD
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know how to open a discussion on discord?

@TobiasWrigstad TobiasWrigstad changed the title Started to revise the pep New PEP for the language summit Apr 30, 2025
Copy link
Copy Markdown
Collaborator

@matajoh matajoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone through and made some updates based on implementation details

pep-9999.rst Outdated
data and uses the built-in functions of these types to modify the data.

To make its instances freezable, types using C extensions must
register themselves using ``register_freezable(type)``. To
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is some sample code you could potentially include:

    PyObject *register_freezable = _PyImport_GetModuleAttrString("immutable", "register_freezable");
    if(register_freezable != NULL)
    {
        PyObject* result = PyObject_CallOneArg(register_freezable, (PyObject *)st->Element_Type);
        if(result == NULL){
            goto error;
        }

        Py_DECREF(register_freezable);
    }

Copy link
Copy Markdown
Collaborator

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good changes, I mainly have some nits and thinks I was unsure about when reading

TobiasWrigstad and others added 2 commits May 7, 2025 10:22
Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>
@TobiasWrigstad TobiasWrigstad changed the title New PEP for the language summit PEP: Deep Immutability for Python May 8, 2025
@TobiasWrigstad TobiasWrigstad merged commit 2237a41 into main May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants