-
Notifications
You must be signed in to change notification settings - Fork 19
macros: give #[pyre_methods] shims a Signature and drop the marker-dict peel #1108
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b27968c
7408ce7
fa0d4ac
30b16fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4257,6 +4257,23 @@ pub(crate) fn split_builtin_kwargs(args: &[PyObjectRef]) -> (&[PyObjectRef], Opt | |
| (args, None) | ||
| } | ||
|
|
||
| /// Length of the leading non-null run of `args`. | ||
| /// | ||
| /// `bind_kwargs_to_signature` pads the flat argument slice out to the full | ||
| /// parameter count with PY_NULL for keyword-only slots and absent optionals, | ||
| /// so the true positional count is the prefix before the first PY_NULL. | ||
| /// A single named function keeps the count off the annotator's shared | ||
| /// iterator-adapter graph: a `take_while` closure inlined per wrapper gives | ||
| /// every `__pyre_wrap_*` shim its own closure type, and merging those | ||
| /// distinct types on one `TakeWhile` graph's input has no common base class. | ||
| pub(crate) fn leading_non_null_count(args: &[PyObjectRef]) -> usize { | ||
| let mut count = 0; | ||
| while count < args.len() && !args[count].is_null() { | ||
| count += 1; | ||
| } | ||
| count | ||
|
Comment on lines
+4260
to
+4274
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Do not infer positional count from a signature-bound scope.
📍 Affects 3 files
🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| /// Cold dictionary-strategy half of the flat builtin-keyword ABI. | ||
| /// | ||
| /// The caller first proves `last` is a dict. Keeping the strategy dispatch | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win
Do not discard the resolver error in the prologue pre-mint.
getuniqueclassdef_for_enum_variantnow performs base materialization, variant interning, and payload-row projection. Each step returnsResult.let _ =drops any failure. The doc comment above states that this pre-mint must leave every subtree member present and UNNUMBERED beforeassign_inheritance_ids. A swallowed error leaves the variant classdef absent. The single numbering pass then misses that subtree, and the later lazy mint produces the Skip-classified instantiation this method exists to prevent.Record or propagate the error so the failure is visible.
♻️ Proposed change
warningroutes through the annotator backlink; usetry_annotatorguarding if the prologue can run without an attached annotator.🤖 Prompt for AI Agents