-
Notifications
You must be signed in to change notification settings - Fork 276
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
Google sync #1019
Conversation
This file contains 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
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
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.
No description provided.