You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(corekit): take the stdlib version detections (get_annotations, UnionType, dict reversal) from compat behind version gates #1709
Describe the bug #1702 (for #1692) detects inspect.get_annotations with _get_annotations = getattr(inspect, 'get_annotations', None), and falls back to a class's own __dict__ below Python 3.10, inside pcapkit/corekit/infoclass.py. The owner prefers version detection and its fallback to live in pcapkit/utilities/compat.py as a re-export, as was asked on #1701.
Expected behavior compat.py re-exports get_annotations, selected by a sys.version_info gate rather than a getattr/hasattr probe (the owner's preference on #1703): inspect.get_annotations on 3.10 and later, and a reader of the class's own __dict__['__annotations__'] below. infoclass.py imports it from there. Behaviour is unchanged on every version.
The same file also probes hasattr(dict, '__reversed__') at pcapkit/corekit/infoclass.py:902 and :993 (dict reversal is Python 3.8+). Those become sys.version_info gates too, found by the #1703 round-2 worker.
A grep of pcapkit/ at 375d37ae5 finds two more probes of the same kind, both in scope here:
changed the title [-]refactor(corekit): take inspect.get_annotations' detection and fallback from compat[/-][+]refactor(corekit): take the stdlib version detections (get_annotations, UnionType, dict reversal) from compat behind version gates[/+]on Oct 14, 2026
#1701 has merged, but #1707 also edits pcapkit/utilities/compat.py and is being rebased onto it now. This stays blocked until #1707 merges, to avoid a third conflict there.
Activity
[-]refactor(corekit): take inspect.get_annotations' detection and fallback from compat[/-][+]refactor(corekit): take the stdlib version detections (get_annotations, UnionType, dict reversal) from compat behind version gates[/+]JarryShaw commentedon Oct 14, 2026
#1701 has merged, but #1707 also edits
pcapkit/utilities/compat.pyand is being rebased onto it now. This stays blocked until #1707 merges, to avoid a third conflict there.JarryShaw commentedon Oct 14, 2026
#1707 has merged, so
compat.pyis free. A worker is on it, usingsys.version_infogates incompat.pyper the ruling on #1703.refactor(corekit,utilities): detect get_annotations, UnionType and di…
docs(conventions): write the rulings from their threads onto the pages (
docs(conventions): write the outstanding rulings onto their pages (#2599