Rebecca Chen
Rebecca Chen
When I look at the imports information that pytype's computed for table_apis.py, I see: ``` google/cloud/spanner_v1/transaction /usr/local/google/home/rechen/python-spanner-orm/.pytype/imports/default.pyi ``` So somehow the `from google.cloud import spanner_v1` import is just being ignored.
importlab is generating the right dependency tree, so that's not the issue: ``` $ importlab spanner_orm/table_apis.py --tree --trim Reading 1 files Source tree: + spanner_orm/table_apis.py :: logging/__init__.py :: typing.py ::...
Ohhh the problem is that typeshed has some google/cloud stubs: https://github.com/python/typeshed/tree/master/stubs/google-cloud-ndb. They're supposed to be for the google-cloud-ndb package, but pytype doesn't check whether a package is installed before using...
Ha, seems like I made (and forgot) the same observation in https://github.com/google/pytype/issues/1081. I think I have a fix.
This was fixed by https://github.com/google/pytype/pull/1291, which will be in the next release (sometime next week).
We're assuming importlib.metadata.DistributionFinder is a name here, when it's actually a nested class: http://google3/third_party/py/pytype/load_pytd.py;l=598;rcl=469523555
If you update to pytype 2022.08.30, you should be able to import `RTLD_GLOBAL` and `RTLD_LOCAL` from `_ctypes` now. (Just to clarify, what will happen "in a few weeks" is that...
Generally, we add support for new typing features a few months after adding support for the corresponding Python version. Since `Self` is in 3.11, which we haven't started seriously looking...
Looks like the direct cause of the error is this line: https://github.com/google/pytype/blob/5609538482a90339bad78d44098a46bb723b586b/pytype/annotation_utils.py#L277 We're not allowing TypeVars that appear only once in a Callable.
Hmm, even if I get rid of the error, it looks like we don't substitute in the right type for `T` in this case =(