Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a451a8

Browse files
chore: fix issue with adding type-hints to 'manager' attribute
When attempting to add type-hints to the the 'manager' attribute intoa RESTObject derived class it would break things.This was because our auto-manager creation code would automaticallyadd the specified annotated manager to the 'manager' attribute. Thisbreaks things.Now check in our auto-manager creation if our attribute is called'manager'. If so we ignore it.
1 parent2cd15ac commit9a451a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎gitlab/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ def _create_managers(self) -> None:
150150
# annotations. If an attribute is annotated as being a *Manager type
151151
# then we create the manager and assign it to the attribute.
152152
forattr,annotationinsorted(self.__annotations__.items()):
153+
# We ignore creating a manager for the 'manager' attribute as that
154+
# is done in the self.__init__() method
155+
ifattrin ("manager",):
156+
continue
153157
ifnotisinstance(annotation, (type,str)):
154158
continue
155159
ifisinstance(annotation,type):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp