Repository navigation
Close small library gaps: typing, enum flags, dataclasses, json options, atexit, decorators - #234
Merged
Merged
Conversation
…ns, atexit, decorators The typed build dropped decorators it did not know (tenacity's @Retry, @atexit.register, user decorators); those now go to the dynamic build. The dynamic build now runs typing (NamedTuple, TypedDict, Generic, Protocol, TypeVar, NewType, cast...), IntEnum/StrEnum/Flag/IntFlag, dataclasses after CPython's dataclasses.py, every json option (hooks, cls=, bytes input, circular and allow_nan checks) and atexit natively, matching CPython; anything else typing-related is refused at build time. Keyword names passed to bridged libraries are interned (orjson). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136hkZjqxLQw3R2836g7wUD
ets-public
marked this pull request as ready for review
November 6, 2026 11:49
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Adam · project thread
What this changes
Roadmap item 3 (small library gaps: tenacity, json/orjson, dataclasses, typing, enum). Native output matches CPython or the build is refused at build time.
Silent wrong answers on main, now fixed:
@tenacity.retry,@atexit.register, user decorators). Those files now go to the dynamic build (typed_guard::odd_decorator).object:NamedTupleclasses failed andisinstance(x, Iterable)was always True (the typed build got that isinstance wrong too).json.loadsignoredobject_hook,object_pairs_hook,parse_float,parse_int,parse_constantandstrict. The typedjson.dumpsignoredallow_nan,default,check_circularandskipkeys.format()of a(str, Enum)member,'%d' % IntEnum,__doc__(always None),__hash__results above 2**61, anddelnot calling__delattr__.New native support:
NamedTuple,TypedDict,Generic,Protocol,TypeVar,NewType,cast,assert_never,reveal_type,TYPE_CHECKINGand the decorators (src/dynpy/typing.rschecks at build time,rt_typing.rsis the runtime).IntEnum,StrEnum,FlagandIntFlag, after enum.py 3.13.cls=with JSONEncoder/JSONDecoder subclasses, bytes input, and CPython's errors.How it was tested
sh tools/ci_local.shpasses (result added below)tests/covers the change: tests/lib/{typing_namedtuple,typing_forms,enum_mixins,enum_flags,dataclasses_more,json_hooks,json_dumps_kwargs,atexit_native}.py, each diffed against python3 3.13Generated by Claude Code