Skip to content

Add type hints to Python function signatures #58

Open

Description

@ryzokuken

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

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

Activity

  1. targos commented on Jul 15, 2020

    @targos
    Member

    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.

  2. ryzokuken commented on Jul 16, 2020

    @ryzokuken
    ContributorAuthor

    it makes it easier / safer to develop

    it can be introduced incrementally

    IIUC, these are both true for this.

  3. cclauss commented on Jul 16, 2020

    @cclauss
    Contributor

    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.

  4. ryzokuken commented on Jul 17, 2020

    @ryzokuken
    ContributorAuthor

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

  5. targos commented on Jul 17, 2020

    @targos
    Member

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

  6. cclauss commented on Jul 17, 2020

    @cclauss
    Contributor

    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.

  7. targos commented on Jul 17, 2020

    @targos
    Member

    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.

  8. ryzokuken commented on Jul 17, 2020

    @ryzokuken
    ContributorAuthor

    @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.

  9. targos commented on Jul 17, 2020

    @targos
    Member

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

  10. cclauss commented on Jul 17, 2020

    @cclauss
    Contributor

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

  11. ryzokuken commented on Jul 17, 2020

    @ryzokuken
    ContributorAuthor

    drop support for Python 2 in nodejs/node first!

  12. changed the title [-]Add type information[/-] [+]Add Python type hints to function signatures[/+] on Oct 11, 2023
  13. changed the title [-]Add Python type hints to function signatures[/-] [+]Add type hints to Python function signatures[/+] on Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions