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
Google sync #1019
Commits on Oct 4, 2021
-
Merge BaseValue.cls and BaseValue.get_class().
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
Configuration menu - View commit details
-
Copy full SHA for e6f5251 - Browse repository at this point
Copy the full SHA e6f5251View commit details -
Allow enum members in Literals.
We still allow unsolvables, because enum members will continue to show up as those until the overlay is enabled. PiperOrigin-RevId: 400070986
Configuration menu - View commit details
-
Copy full SHA for 89d9e32 - Browse repository at this point
Copy the full SHA 89d9e32View commit details -
Rename annotations_util to annotation_utils.
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
Configuration menu - View commit details
-
Copy full SHA for 2bef63f - Browse repository at this point
Copy the full SHA 2bef63fView commit details -
Disable enum equality checks and don't use atomic strings for canonic…
…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
Configuration menu - View commit details
-
Copy full SHA for 32448f8 - Browse repository at this point
Copy the full SHA 32448f8View commit details -
Add a separate logger for debug tracing.
* 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
Configuration menu - View commit details
-
Copy full SHA for bc6881b - Browse repository at this point
Copy the full SHA bc6881bView commit details -
Check Instance.maybe_missing_members earlier during attribute access.
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
Configuration menu - View commit details
-
Copy full SHA for d7afc20 - Browse repository at this point
Copy the full SHA d7afc20View commit details -
Fix a bug in matching callables with TypeVar parameters.
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
Configuration menu - View commit details
-
Copy full SHA for e798285 - Browse repository at this point
Copy the full SHA e798285View commit details -
Configuration menu - View commit details
-
Copy full SHA for 300a3d3 - Browse repository at this point
Copy the full SHA 300a3d3View commit details