dib-lab / khmer

In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more
http://khmer.readthedocs.io/
Other
748 stars 295 forks source link

Python type checking #1319

Open mr-c opened 8 years ago

mr-c commented 8 years ago
luizirber commented 8 years ago

Are there plans to submit it to typeshed?

mr-c commented 8 years ago

It is a good idea, but not on my personal to-do list.

On Thu, Oct 15, 2015, 01:42 Luiz Irber notifications@github.com wrote:

Are there plans to submit it to typeshed https://github.com/python/typeshed?

— Reply to this email directly or view it on GitHub https://github.com/dib-lab/khmer/issues/1319#issuecomment-148234134.

souravsingh commented 8 years ago

I would like to work on this.How Do I start?

mr-c commented 8 years ago

Hello Sourav,

Thank you for your offer to contribute. There is a checklist in the issue description. I have not personally added type notation to Python code before so I don't have any specific advice. I recommend following the developer guidelines for this project, particularly the part about opening a pull request early in the development process.

FYI: I am no longer working on this project as part of my job at UC Davis but I will try to provide assistance on a time available basis.

On Wed, Nov 4, 2015, 23:13 Sourav Singh notifications@github.com wrote:

I would like to work on this.How Do I start?

— Reply to this email directly or view it on GitHub https://github.com/dib-lab/khmer/issues/1319#issuecomment-153975225.

luizirber commented 8 years ago

There is also a tool for stub generation: https://github.com/o11c/stubtool

luizirber commented 7 years ago

Since we dropped Python 2 (as of #1769) and Cython 0.27 will (hopefully?) support the typing module syntax, we can start supporting more of this in function declarations (variable declaration support is only available as syntax in 3.6, but it is supported (as comments) in 3.5.

betatim commented 7 years ago

Honest question: what problem (we have) does having type annotations solve? The only one I can think of is "making it easier for a dev/user to figure out what they should pass to a function". I'd argue we should try and solve that by better naming, not type annotations. My current thinking on this is inspired/driven by working on code bases where "everyone" uses a powerful IDE, with type annotations and as a result the code becomes "impossible" to navigate without an IDE...which I think is not ideal. Both for devs without an IDE and users who are trying to work out what the code does.

So overall I'd be -0 on this unless it fixes a really painful problem.

mr-c commented 6 years ago

@betatim For the CWL reference implementation, type annotations & the mypy static checker found lots of bugs and helped clean up the code as well.

My "powerful IDE" is VIM and it is currently PEP 484 unaware, but I still find them highly useful.

I agree that variable names matter :-)