-
Notifications
You must be signed in to change notification settings - Fork 930
Open
Description
Summary
If someone copy-pastes code from this example, they will get type errors in a type checker like pyright.
Detailed Information
The type hints for NodeImage say that name
is a str
:
https://github.com/apache/libcloud/blob/v3.8.0/libcloud/compute/base.py#L451
However, in one of the examples in docs, name
is set to None
:
https://libcloud.readthedocs.io/en/stable/compute/examples.html#create-ec2-node-using-a-custom-ami
This means that a type-checker like pyright will complain if you follow this example.
Should the type hint and/or the example be changed?
My workaround was to add # type: ignore
to silence the warning, but I figured I can open an issue in case someone else might run into the same thing.
Metadata
Metadata
Assignees
Labels
No labels