-
-
Notifications
You must be signed in to change notification settings - Fork 205
Open
Description
@magics_class
class SimpleGPTMagics(Magics):
api_type = Unicode("openai", help="The type of api that will be used to query the models").tag(config=True)pyright report
Diagnostics:
1. Argument of type "Literal['openai']" cannot be assigned to parameter "default_value" of type "Sentinel" in function "__init__"
"Literal['openai']" is incompatible with "Sentinel" [reportGeneralTypeIssues]
traitlets/traitlets/traitlets.py
Lines 479 to 497 in 05d6ecb
| class TraitType(BaseDescriptor): | |
| """A base class for all trait types.""" | |
| metadata: t.Dict[str, t.Any] = {} | |
| allow_none = False | |
| read_only = False | |
| info_text = "any value" | |
| default_value: t.Optional[t.Any] = Undefined | |
| def __init__( | |
| self, | |
| default_value=Undefined, | |
| allow_none=False, | |
| read_only=None, | |
| help=None, | |
| config=None, | |
| **kwargs, | |
| ): | |
| """Declare a traitlet. |
traitlets/traitlets/traitlets.py
Lines 135 to 141 in 05d6ecb
| Undefined = Sentinel( | |
| "Undefined", | |
| "traitlets", | |
| """ | |
| Used in Traitlets to specify that no defaults are set in kwargs | |
| """, | |
| ) |
Obviously, the argument of TraitType.__init__, default_vaue is infered to Sentinel, what can I do to suppress the diagnostic?
Metadata
Metadata
Assignees
Labels
No labels