You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to import from a module that uses __getattr__ in its stub file, pyre can't find the name. For example
from django.contrib.auth.decorators import login_required
results in
Undefined import [21]: Could not find a name `login_required` defined in module `django.contrib.auth.decorators`.
This import worked prior to 5f1d94d. I'm running into this in PyGotham/awards#78, but I'm able to reproduce this in a file that just contains the import.
The text was updated successfully, but these errors were encountered:
This is another bug in our stubs: we replaced placeholder stubs # pyre-placeholder-stub with __getattr__() -> Any where it should be __getattr__(name: str) -> Any. I will fix that soon.
dirn
added a commit
to dirn/pyre-check
that referenced
this issue
Aug 4, 2020
When Python calls a module's `__getattr__` function, it passes it the
name of the attribute. Without including the argument in the signature,
Pyre can't find module attributes not explicitly included in the stubs.
This results in `Undefinied import` errors.
To address this, a `name` argument (typed as `str`) is being added to
each `__getattr__` stub.
Fixesfacebook#286
When trying to import from a module that uses
__getattr__
in its stub file,pyre
can't find the name. For exampleresults in
This import worked prior to 5f1d94d. I'm running into this in PyGotham/awards#78, but I'm able to reproduce this in a file that just contains the import.
The text was updated successfully, but these errors were encountered: