Skip to content
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

Google sync #1620

Merged
merged 22 commits into from
Apr 24, 2024
Merged

Google sync #1620

merged 22 commits into from
Apr 24, 2024

Conversation

rchen152
Copy link
Contributor

No description provided.

rchen152 and others added 22 commits April 24, 2024 09:50
PiperOrigin-RevId: 625414033
Also removes a Python 2 TODO that I happened to spot while looking at our
current implementation of __build_class__.

PiperOrigin-RevId: 625451422
PiperOrigin-RevId: 625487997
PiperOrigin-RevId: 625493532
Largely ported from abstract.function.Args.simplify, with a few changes because
we don't handle indefinite iterables well yet, and refactored a bit to be
easier to read and type check.

Not tested for now because it also needs changes to LIST_EXTEND and a few other
places to handle unpacking of `Any` better, and this change was getting long
enough already. Added a skipped test that works in the execution phase, but not
the analyse-with-fake-args phase.

PiperOrigin-RevId: 625859869
Merges posargs and starargs before handling splats, and does not replace splats
with Any when matching args since we might want to forward them through several
function calls.

PiperOrigin-RevId: 626107538
- Replaces `internal.ConstKeyDict` with `internal.FunctionArgsDict`
- Adds better support for indefinite `containers.Dict` and conversion between
  `Dict` and `FunctionArgsDict`
- Fixes balancing of args between `kwargs` and `**args` in the arg mapper

PiperOrigin-RevId: 626473976
The `abstract.Dict` and `abstract.List` containers now only get their update
methods called with a well-formed Dict/List

PiperOrigin-RevId: 626520407
Adds the code needed to detect and call a custom implementation of
type.__new__. An implementation of EnumMeta.__new__ will come in a later CL.

Also fixes a minor issue where convert.py was failing to add modules and class
prefixes to method names.

PiperOrigin-RevId: 626545872
Both SimpleFunction and BoundFunction are subclasses of BaseFunction.

PiperOrigin-RevId: 626560114
…e file.

frame.py is already sort of long and will only get longer as we add more
opcodes. This pulls most of the function calling code, which is fairly
self-contained, into a separate file.

PiperOrigin-RevId: 626664567
Replaces `A[X]` with `A`, mostly so code with subscripted type annotations can
work without crashing.

PiperOrigin-RevId: 627133846
PiperOrigin-RevId: 627195965
I started out by trying to implement overlays following our current design,
with an overlay module containing overlay members, but I realized that this
quickly becomes a pain if you want to replace a method of a class (e.g., to get
at EnumMeta.__new__, I need to create overlay objects for the enum module, the
EnumMeta class, and finally the EnumMeta.__new__ method).

Here's a potential alternative design that involves using decorators to
"register" individual objects as overlays and having convert.py do overlay
registry lookups. Let me know what you think.

PiperOrigin-RevId: 627541189
Removes the 'indefinite' attribute from abstract.Dict and adds it to
abstract.FunctionArgTuple. This way, FunctionArgTuple and FunctionArgDict have
a fully consistent typing story, but the general Tuple and Dict representations
are kept relatively simple.

I reran ./rewrite/tests/run.sh, and this change has no effect on our
pass/fail/error numbers.

PiperOrigin-RevId: 627558177
@rchen152 rchen152 merged commit 07e902e into main Apr 24, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants