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 }}
Repository navigation
RepositoryMixin base class unresolvable by pyright due to implicit submodule access #3342
Pyright (and basedpyright) cannot resolve gitlab.base.RESTObject here because import gitlab does not make gitlab.base accessible as an attribute — Python only guarantees submodule access after an explicit import of that submodule. This is a runtime side effect of the import system that type checkers (correctly) don't model. See pyright docs on implicit submodule access.
As a result, _RestObjectBase is Unknown, which propagates through RepositoryMixin and into all classes that inherit it (e.g. Project). This causes spurious reportUnknownMemberType / reportUnknownVariableType warnings for any code using Project attributes.
Suggested fix
Add an explicit import gitlab.base inside the TYPE_CHECKING block:
This is a one-line change with no runtime impact (it's only evaluated by type checkers).
The same pattern may exist in other files — a quick search for gitlab.base.RESTObject or gitlab.base.RESTManager in TYPE_CHECKING blocks would surface them.
Activity
fix(types): add explicit submodule import for pyright compatibility
fix(types): add explicit submodule import for pyright compatibility
fix(types): add explicit submodule import for pyright compatibility