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 #1019

Merged
merged 8 commits into from Oct 4, 2021
Merged

Google sync #1019

merged 8 commits into from Oct 4, 2021

Conversation

rchen152
Copy link
Contributor

@rchen152 rchen152 commented Oct 4, 2021

No description provided.

rchen152 and others added 8 commits October 4, 2021 11:55
This simplifies abstract.py by merging the cls attribute and the get_class()
method into a single cls attribute. Previously, for a class X without an
explicit metaclass, X.cls == None and x.get_class() == Type[X]. Now,
X.cls == Type[X]. Other differences:
* cls can no longer be None. This lets us get rid of a lot of `if cls` checks.
* For SimpleValue and ParameterizedClass, cls is evaluated lazily using a
  property and a private attribute. This is done because trying to access
  attributes like vm.convert.type_type before they're defined leads to
  problems. I added a vm.convert.minimally_initialized attribute so that the
  cls property can determine when it's safe to access convert attributes.

Also fixes an abstract classmethod bug exposed by this change.

Where possible, I have tried to keep user-visible behavior the same as before,
even in cases in which I'm not sure the previous behavior was correct (see the
new TODO in matcher.py), since this is already a pretty complicated change. The
one thing I did change was that the types of classes are now inferred as `type`
rather than `Any` more often, since the case in which the type became `Any` due
to cls being None no longer exists.

PiperOrigin-RevId: 399973506
We still allow unsolvables, because enum members will continue to show up as those until the overlay is enabled.

PiperOrigin-RevId: 400070986
Every other utility module we have is named x_utils, so changing the name of
this one makes it easier to remember.

PiperOrigin-RevId: 400134359
…al names.

- Enum equality checks were breaking some targets due to [].
- Using atomic strings for the names of canonical enum instances leads to very weird error messages where the lookup fails due to the name being `''`. (See the new test for an example.)

PiperOrigin-RevId: 400247284
* Adds the trace.* logger hierarchy
* Adds a context manager to turn on tracing for a block of code
* Adds a decorator to trace a function's args and return value

PiperOrigin-RevId: 400313706
maybe_missing_members needs to be checked before calling __getattr__, since a
missing member may have a different type from the __getattr__ fallback.

PiperOrigin-RevId: 400457631
As it turns out, we already have a Matcher._get_param_matcher() method for
solving the exact problem with bounded TypeVars encountered in the attr stubs;
we just need to remember to use it when matching a Callable instance against a
Callable. (Previously, it was only used when matching an actual function
against a Callable.)

PiperOrigin-RevId: 400457695
PiperOrigin-RevId: 400778002
@google-cla google-cla bot added the cla: yes label Oct 4, 2021
@rchen152 rchen152 merged commit bff3736 into master Oct 4, 2021
@rchen152 rchen152 deleted the google_sync branch October 4, 2021 19:48
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

3 participants