gh-113993: Allow interned strings to be mortal, and fix related issues by encukou · Pull Request #120520 · python/cpython · GitHub

github.com

Tin mới

encukou:immortal-interned

miss-islington-app

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

Interned strings are immortal, despite what the documentation says #113993

Declare explicit interning routines

Use _PyUnicode_InternStatic for the statically allocated stuff

Add _PyUnicode_InternStatic and extra checks

Check against immortalizing un-interned strings

Add _PyUnicode_InternImmortal & make marshal use it

Remove special case that makes previously-immortal strings STATIC

Split _PyUnicode_InternMortal and _PyUnicode_InternImmortal

Do the refcnt dance in _PyUnicode_InternMortal & _PyUnicode_ClearInte…

Deallocate mortal interned strings

Use _PyUnicode_InternMortal in codecs

Start a notes document

Handle attempts to "overwrite" interned heap types by static ones

Intern statically allocated non-identifier strings at init

Parenthesize the LATIN1 macro argument

Don't create the per-interp interned_dict until after InitStaticStrings

Move hashmap destroy to _PyUnicode_ClearInterned (symmetry with creat…

Special-case short string singletons

Verify we don't add process-global entries after a per-interp dict ex…

More editing of the InternalDocs write-up

Only readjust refleak tests for *immortal* interned strings

Be pedantic with the ref total

Split InternInPlace in sysmodule

Split InternInPlace in import

Split InternInPlace in getargs

Use mortal strings in type_setattro

Use mortal string in type_module

Use mortal strings for object attributes

Use mortal strings for code object names