Skip to content

Type hints #80

Description

@nkantar

Hi, @carltongibson!

First of all, mega thanks for Neapolitan! I’ve looked at it before, but only started using it last night on a small side project, and already love it. The simplicity is beautiful, and the small surface area is a major feature.

The only thing that’s I’m missing are type hints.

I know type hints are not to everyone’s taste. They add a non-trivial amount of syntax and maintenance burden, and Python is certainly very much Python even without them. So, I’m not here to criticize that choice, but to gauge (your) interest in them.

Fortunately there are multiple ways of adding type hints to a project. I myself am aware of three:

  1. right in the .py source code
  2. in .pyi files living alongside the source code
  3. in .pyi files in an entirely separate project

I’ve already started working on option 3 locally, and it’s serving me well. I’d like to see if I can finish it this weekend and publish on PyPI as something like neapolitan-types or neapolitan-stubs. However, it seemed prudent to check in and see if you have a preference for one of the first two options, and redirect my effort if so.

For what that’s worth, I’m fine with all three options. Option 3 is probably the easiest way forward, and converting to option 2 would require minimal effort some day, should we all choose to do so. Option 1, however, is the most “aggressive”, and seems in some ways perhaps counter to the very spirit of Neapolitan, particularly in a world where django-stubs exists. I have some preference for starting with option 3, to avoid affecting development of Neapolitan itself, but welcome all thoughts and feelings.

What say you?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions