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
{{ message }}
This repository was archived by the owner on Sep 3, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 3, 2026. It is now read-only.
[attribute-error] when usage is protected by an if statement #1867
pytype doesn't assume an attribute access returns the same object when called twice in succession. the workaround is to assign it to a local variable first, i.e. x = cls.mock_tzinfo; if x: ...
@martindemello - hmm, that seems quite an unfortunate choice, do you know if there are plans to change that?
(the fact you refer to it as a workaround gives me a little hope...)
Hi, thank you for your report. Google is shifting its effort to a different approach for type checking apart from pytype, and we're not planning to put in any effort in the near future in pytype, so we'll close this issue. Please see the announcement here.
Activity
martindemello commentedon Feb 11, 2025
pytype doesn't assume an attribute access returns the same object when called twice in succession. the workaround is to assign it to a local variable first, i.e.
x = cls.mock_tzinfo; if x: ...cjw296 commentedon Feb 12, 2025
@martindemello - hmm, that seems quite an unfortunate choice, do you know if there are plans to change that?
(the fact you refer to it as a workaround gives me a little hope...)
h-joo commentedon Aug 20, 2025
Hi, thank you for your report. Google is shifting its effort to a different approach for type checking apart from pytype, and we're not planning to put in any effort in the near future in pytype, so we'll close this issue. Please see the announcement here.
[Units] Suppress irrelevant attribute-error(s) from pytype
[Units] Suppress irrelevant attribute-error(s) from pytype
[Units] Suppress irrelevant attribute-error from pytype