Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-103763: Implement PEP 695#103764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
gh-103763: Implement PEP 695#103764
Changes from1 commit
Commits
Show all changes
232 commits Select commitHold shift + click to select a range
9c8cd71 Moved portions of earlier prototype into latest main CPython branch. …
msfterictraut609ac0d Run Tools/build/generate_global_objects.py
JelleZijlstra7a5e457 Basic C implementation of TypeVar, TypeVarTuple, ParamSpec
JelleZijlstra1e0b74c fix TypeVar signature
JelleZijlstra2a5023a fix TypeVar argument parsing
JelleZijlstra1bc8574 ParamSpecArgs/Kwargs
JelleZijlstraed42796 make typing importable
JelleZijlstrad06f43d Add some things
JelleZijlstra830b36a Updated unit tests to reflect the latest PEP 695 spec.
msfterictrautb6bf2bc Merge remote-tracking branch 'erictraut/type_param_syntax4' into tvob…
JelleZijlstra6bb4795 Make *Ts work
JelleZijlstrac7c1618 Just call typing.py
JelleZijlstra772920f attempt at pickling
JelleZijlstra6ff6f5a better approach
JelleZijlstra9fdf373 fix a few tests and refcount bugs
JelleZijlstraf7c513d Use Name expr for TypeAlias
cdce8p1d7b035 Add ast optimizer for typeparam
cdce8p85a4409 Use Name expr for TypeParameter
cdce8p55d0fd9 Revert AST changes for TypeParams
cdce8p618e173 Merge pull request #7 from cdce8p/eric-ast-changes
erictrautbef978f broken compiler before merge
JelleZijlstra3cd026a Merge remote-tracking branch 'erictraut/type_param_syntax4' into tvob…
JelleZijlstrab12663d Works for functions
JelleZijlstrabb9c43c fall back to normal scope
JelleZijlstra037ddfa does not exactly work
JelleZijlstraa62f0c2 commit before new approach
JelleZijlstra9c7a153 New approach
JelleZijlstraaa8ea68 correctly make it a cellvar
JelleZijlstraab6b718 Now it works
JelleZijlstradba4293 fix defaults
JelleZijlstrae36c5f5 undo some unnecessary changes
JelleZijlstra21e1b1a support async def
JelleZijlstra8505134 start class support
JelleZijlstra338b978 detect duplicate type params
JelleZijlstra04bc911 clean up some whitespace
JelleZijlstra521bd81 Improve some tests
JelleZijlstraf2d91b0 No runtime error there
JelleZijlstraccf68d9 actually generate a typevar
JelleZijlstra6159d75 refactor typeparam blocks
JelleZijlstrad9c0d90 Fix nested class scopes (functions)
JelleZijlstrad26b82a fix it in classes too
JelleZijlstra423d2de Support bounds
JelleZijlstrafdd8877 Use dummy class to get TypeVar-like types
JelleZijlstra2461ed5 fix typo in test
JelleZijlstrae9a196f Add union support to TypeVar (and ParamSpec, somewhat dubiously)
JelleZijlstra536cf13 add function.__type_variables__
JelleZijlstrac0b04e3 Generic work
JelleZijlstra59e6fa0 Use _Py_DECLARE_STR
JelleZijlstra5521c7d Support inheriting from Generic
JelleZijlstrab9d8fbb Fix up qualnames
JelleZijlstraf3340c2 Update the magic number, rearrange typing.py accordingly
JelleZijlstrab5de372 fix missing initialization
JelleZijlstrafa81c01 set __type_variables__ on classes
JelleZijlstra7aeee08 Add docs to typevarobject.c
JelleZijlstraa7e6bcb drop Python implementations of Generic, TypeVar, etc.
JelleZijlstrafe84458 fix Generic
JelleZijlstra34c024d make generics instantiable
JelleZijlstrad9ec56e fix NamedTuple
JelleZijlstra6ab8b1e fix some tests
JelleZijlstrad916974 one more
JelleZijlstrab38dea4 Use a heap type for Generic
JelleZijlstra8991bb1 Better way to set __type_variables__ in the class
JelleZijlstrac3f520a Fix TypeVar | "ForwardRef"
JelleZijlstrae668ed8 Make ParamSpecArgs and Kwargs not subclassable
JelleZijlstra2b844f4 Correctly unpack TypeVarTuple
JelleZijlstra47d24d9 Add support for type aliases (but not for computing the value)
JelleZijlstra8ad0b5b Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra6312d7b fix merge
JelleZijlstra48e23b0 Avoid complicating compile_call_helper
JelleZijlstradec31ae Apparently it is a length-0 list if there are no typeparams, not NULL
JelleZijlstra062999c Fix GC for TypeAlias
JelleZijlstra9147a4a fix warnings
JelleZijlstra1b043c8 Add to globals-to-fix
JelleZijlstra16cb6a5 Add to _freeze_module.vcxproj
JelleZijlstra1bdfb75 Use heap types, fixing pickling
JelleZijlstra308c7c1 Fix GC
JelleZijlstraff22d22 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstrac4ce394 Self-review
JelleZijlstraf02199f It's supposed to be called TypeAliasType
JelleZijlstra3fe019b Allow evaluating TypeAlias
JelleZijlstra737d96a Support __or__ on type aliases
JelleZijlstra6fe9476 fix | and subscripting on TypeAliasType
JelleZijlstra80a9efb Test fixes and new tests
JelleZijlstra21b3aec Add syntax error for nonlocal as specified by the PEP
JelleZijlstra30487a5 Implement TypeAlias repr
JelleZijlstra1575c66 __type_variables__ -> __type_params__
JelleZijlstraa6045f0 Remove POP_NULL
JelleZijlstra2c8b4f1 Lazily evaluate TypeVar bounds/constraints
JelleZijlstra66851e6 Add NEWS
JelleZijlstrabe059c1 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstraac7f722 Disallow yield/yield from/await/walrus
JelleZijlstra0f70925 fix doctests
JelleZijlstrae17c3b0 Stop altering the execution environment
JelleZijlstra45696ae Disallow walrus/yield while evaluating generics
JelleZijlstra02e0a8a Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra7a8fc14 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra7195162 regen all, minor quality improvements
JelleZijlstra5fbd4d5 fix leaked ref to the TypeAlias type
JelleZijlstraf86be9c Fix another leak
JelleZijlstra77b3807 Deallocate Generic correctly
JelleZijlstraf448248 Avoid a new funcflags
JelleZijlstrad32bc61 Fix missing INCREF
JelleZijlstra27a8a4c Fix repr() for recursive type aliases
JelleZijlstra44b9222 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra445a39b Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra7fa37b4 Fix refleak in ParamSpecArgs/Kwargs
JelleZijlstra880f066 Add tp_clear methods
JelleZijlstra3d8e24e regen-global-objects
JelleZijlstra74c1a0d Apparently not
JelleZijlstrad5b86c5 Merge branch 'main' into tvobject
JelleZijlstra3b6098d Add lookahead to grammar
JelleZijlstra9632c02 First try! It fails! James Powell rules apply.
larryhastings8a0ecb7 simplify the intrinsic
JelleZijlstra0bb175a Changed strategy, func_class_dict and *_CLASS_DICT.
larryhastings5e4ec0e Update comment on new magic number.
larryhastings12d3004 Cleanup leftover gunk from previous approach.
larryhastings6c3f65a Add class.__globals__, fix refcnt bugs. Thx Jelle!
larryhastings84a00ce LOAD_CLASS_DICT also checks globals. Thx Jelle!
larryhastingse0acb87 Make LOAD_CLASS_DICT also look in the global namespace and rename it …
JelleZijlstrad77c4fb Merge branch 'loadclass' into tvobject
JelleZijlstraea66c7c Use INTRINSIC_SET_CLASS_DICT
JelleZijlstrab314a3f Correctly handle class namespaces in TV bounds
JelleZijlstra2e913ca Same for type aliases
JelleZijlstra394d128 Add test cases
JelleZijlstrabd49622 Handle name mangling
JelleZijlstrabf45a8e I don't need __globals__ and it causes a lot of failures
JelleZijlstrace7fe9c Fix another test
JelleZijlstrae5a6c21 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra96324a5 Extend NEWS entry, give credit to Larry
JelleZijlstrafd0f7b4 Fix GC tracking in error conditions
JelleZijlstrae784da1 More error paths
JelleZijlstra72fc40c Fix the NEWS?
JelleZijlstra4b6a815 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra93a4552 Can't have multi-line bulleted lists in NEWS
JelleZijlstrab36b7af More test cases, remove redundant comment
JelleZijlstraa85fb6c Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra6454026 Add LOAD_CLASSDICT_OR_DEREF
JelleZijlstra21667d9 Remove outdated comment
JelleZijlstrae65d668 Add helper function to tests
JelleZijlstrae0a0b04 Expose TypeVar and friends through _typing
JelleZijlstrad5c44f5 Remove unnecessary symtable entry
JelleZijlstrace6a990 Rename variable for clarity
JelleZijlstra2fc9cc7 fix shadowed test
JelleZijlstra3f71911 Use run_code in test_type_aliases too
JelleZijlstra0891a61 Update NEWS
JelleZijlstra78a9ba2 type is a soft keyword too
JelleZijlstrac0b45e1 add to test_ast
JelleZijlstra16a037f Move functions closer together
JelleZijlstrac5d9378 try this way
JelleZijlstra0399ed4 comments
JelleZijlstra782fc35 Maybe this
JelleZijlstraa092896 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra0241da5 avoid special qualname handling
JelleZijlstra5b3a204 Fix opcode classification
JelleZijlstra78f3f4b Fix qualname test
JelleZijlstra9d3177b Harmonize implementation of the two intrinsics
JelleZijlstrac52179c Simplify LOAD_LOCALS at the cost of compiler complexity
JelleZijlstrad0fa718 fix WASM
JelleZijlstraf0936de Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra5259096 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstrac3d6464 Fix compiler warning
JelleZijlstraf580583 use check_syntax_error
JelleZijlstra17c8060 Better error messages for illegal bounds/constraints
JelleZijlstraf4ea500 Add CHECK_VERSION for type param lists
JelleZijlstra43bcd02 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra827b9e5 Test that super() works correctly within a hidden function
JelleZijlstra71cef78 Use a __classdict__ cell to store the class namespace (#3)
JelleZijlstra80ffbf3 Merge branch 'main' into tvobject
JelleZijlstrae786382 Fix a test
JelleZijlstra2a8f0ef Remove stray function declarations
JelleZijlstra967f100 More thorough tests
JelleZijlstra4cbbd24 More CR on tests
JelleZijlstra8dfb93d Update comment
JelleZijlstra43f0270 Real error for type_check
JelleZijlstra0b35c6c Use vectorcall
JelleZijlstraa2f3c75 Small fixes to typevarobject.c
JelleZijlstrac51b9fc mod, not mad
JelleZijlstra047abba Use dict_add_o for class cells
JelleZijlstra51a4655 Small compiler fixes
JelleZijlstra5e68cd8 Refactor compiler_function for correct scope handling
JelleZijlstra3b63b76 Same for classes
JelleZijlstra281f575 And for type aliases
JelleZijlstraa3cd2e7 fixup
JelleZijlstraa4f6076 Remove unnecessary LOAD_LOCALS
JelleZijlstra88ac5dc Remove .type_params for functions
JelleZijlstra32fc89c Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra02f1fca Forgot one regen
JelleZijlstra249ca43 Simplify bytecode as suggested by Carl
JelleZijlstra645b08b Add some test cases for unusual calls
JelleZijlstra17c30f6 Avoid compiler_nameop change
JelleZijlstra0067e00 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra39ace71 Rip out making bound a set
JelleZijlstraa1c59f7 New solution for nonlocal
JelleZijlstraf7e6219 Simplify TypeAliasType.__repr__
JelleZijlstra8f54b02 Remove bogus assertions
JelleZijlstrabb2df61 Remove redundant condition
JelleZijlstrafdf65ad Use compiler_addop_o
JelleZijlstra4fecf7d Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstraf8406ce Undo unnecessary bracing changes
JelleZijlstrafd4fe5c Separate out and expand nonlocal tests
JelleZijlstra0b94580 Add comments to the enum
JelleZijlstrae952d61 Some more tests and consistent naming
JelleZijlstra785dd45 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstrabe70e3c Use _PyST_IsFunctionLike in comprehension inlining code
JelleZijlstra92c29e7 Simplify Generic creation
JelleZijlstra529c74d Public constructor for TypeAlias
JelleZijlstra531fcf7 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra497e22a regen opcode_targets.h
JelleZijlstrabfb5ac0 Add test now that it no longer crashes
JelleZijlstraa1be61d Fix one refleak
JelleZijlstra1e9273c Fix the other refleak
JelleZijlstrabc37579 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra3817ab4 Fix one more refleak
JelleZijlstraf2a9393 Remove unrelated change
JelleZijlstra4f1223e remove stray raw assert
JelleZijlstrad490251 Merge branch 'main' into tvobject
JelleZijlstra33f4c12 Update typevarobject.c: use Py_RETURN_NONE
JelleZijlstrab9f4540 Review feedback
JelleZijlstraa64922f Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra8a783b3 Update Lib/test/support/__init__.py
JelleZijlstra9e6658a Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra0aad1f4 Use PyObject for TypeVar etc. names
JelleZijlstraa22a08f Reorganize compiler opcodes; no more LOAD_CLASSDEREF
JelleZijlstra1328c75 Merge branch 'main' into tvobject
JelleZijlstra7d6016e Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstra1401209 Fix another class scoping oddity
JelleZijlstrae049f5a Make test still succeed under PEP 649
JelleZijlstrac4d9ec4 Fix bug with explicit global in class scope; rename flag for clarity
JelleZijlstrab93f85e Fix more similar cases
JelleZijlstraf412f49 Merge remote-tracking branch 'upstream/main' into tvobject
JelleZijlstrad4e72a5 A few more tests
JelleZijlstra08d931c Remove redundant function
JelleZijlstraFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Fix another test
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commitce7fe9cc25e3401d565f25a51761ca0ffed2a340
There are no files selected for viewing
2 changes: 1 addition & 1 deletionLib/test/test_sys.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.