Skip to content
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

Add type hints to Python function signatures #58

Open
ryzokuken opened this issue Jul 15, 2020 · 11 comments
Open

Add type hints to Python function signatures #58

ryzokuken opened this issue Jul 15, 2020 · 11 comments

Comments

@ryzokuken
Copy link
Contributor

Add type information to the codebase. Thoughts? @cclauss @targos.

Ref: https://docs.python.org/3/library/typing.html

@ryzokuken ryzokuken added the good first issue Good for newcomers label Jul 15, 2020
@targos
Copy link
Member

targos commented Jul 15, 2020

I'm not used to Python and have never worked with typing, so my opinion wouldn't be very informed.
I work with TypeScript though and do like type annotations, so I'm not opposed to that if it makes it easier / safer to develop and if it can be introduced incrementally.

@ryzokuken
Copy link
Contributor Author

it makes it easier / safer to develop

it can be introduced incrementally

IIUC, these are both true for this.

@cclauss
Copy link
Contributor

cclauss commented Jul 16, 2020

I am a huge fan of type hints in Python but they break compatibility with Python 2. If we a green light to drop legacy Python then let's go for it.

@ryzokuken
Copy link
Contributor Author

Personally, I don't see why we should let Python 2 hold us back in 2020?

@targos
Copy link
Member

targos commented Jul 17, 2020

As long as Node.js and node-gyp support Python 2 in their main development branches, I am against removing support here.

@cclauss
Copy link
Contributor

cclauss commented Jul 17, 2020

Unfortunately, this is not a choice that one person can make. How do we get the Node.js Technical Steering Commitee to agree to drop support for legacy Python which died 200 days ago.

@targos
Copy link
Member

targos commented Jul 17, 2020

You don't necessarily need the whole TSC to agree on it. The process is to open a PR dropping Python 2. If we cannot reach consensus (i.e. some collaborator(s) disagree), then the TSC will have to make a decision.

@ryzokuken
Copy link
Contributor Author

@targos what does the PR need to do? Since the tooling is already Python 3 compatible, I suppose we're looking at a doc-only PR here.

@ryzokuken ryzokuken removed the good first issue Good for newcomers label Jul 17, 2020
@targos
Copy link
Member

targos commented Jul 17, 2020

Almost doc-only, yes. There's also at least one place where we validate the python version (the configure file)

@cclauss
Copy link
Contributor

cclauss commented Jul 17, 2020

Add Python type hints and drop support for Python 2 sounds like a nice PR title to me.

@ryzokuken
Copy link
Contributor Author

drop support for Python 2 in nodejs/node first!

@cclauss cclauss changed the title Add type information Add Python type hints to function signatures Oct 11, 2023
@cclauss cclauss changed the title Add Python type hints to function signatures Add type hints to Python function signatures Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants