-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Advertise typing support #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I did not know that it existed. There are small things to correct (thanks for correcting the lint error, btw), but we're almost good to go :)
@@ -46,17 +46,17 @@ def __repr__(self) -> str: | |||
|
|||
|
|||
class Lexer: | |||
def __init__(self, inp, stopwords: List[str]): | |||
def __init__(self, inp: str, stopwords: List[str]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be "Lexer"
not None
, then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__init__
always returns None
(__new__
returns the type of the object)
https://docs.python.org/3/reference/datamodel.html#object.__init__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok, I thought they were returning the Object itself. Good to know :)
@@ -1,43 +1,54 @@ | |||
[build-system] | |||
build-backend = "setuptools.build_meta" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this mandatory? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, setuptools
is the default at the moment
https://peps.python.org/pep-0518/#build-system-table
But I guess it's good to be explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, then :)
Thanks for the very quick reply! Yeah, adding a |
Thank you :) |
Thank you for the quick review! 😁 |
The main point of this was to add a
py.typed
marker so that users can get the typing annotations.To make sure that all works nicely, it also
mypy
configurationmypy
step to the CImypy --strict
.