-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Python type hints #32
Comments
Hi, I have thought about it but always decided against it. Since you have asked, I committed some type hints in 3fdd3f8. Is this what you had in mind? Thanks |
Hi! Thank you for your quick changes. This is already very useful. One of my biggest advantages would be if the return type is a defined object. def searchCVE(...) -> CVE:
@dataclass
class CVE:
descriptions: [Description]
# ...
@dataclass
class Description
lang: str
value: str |
Also, I saw the usage of lastModStartDate: Tuple[str, datetime] = None,
lastModEndDate: Tuple[str, datetime] = None, Shouldn't this be a lastModStartDate: str | datetime = None,
lastModEndDate: str | datetime = None, |
The library is amazing, but having to suppress strict type checking on every call to the library can be a hassle. |
Please feel free to submit any PRs for type hints. I have not had the time to do research to learn proper type hints. My original statement was negligent and uninformed at that time, but since this issue was opened I have been trying to learn and implement them, just have not had time. In that original statement, I meant that when I was creating NVDLib I didn't think they would be useful. I can see how useful they are in documentation so I am in full support of adding type hints. |
Hi @vehemont. Thank you for this excellent library 😁
Have you considered adding type hints to function parameters, return values, and class attributes?
Something along the way like this:
The text was updated successfully, but these errors were encountered: