ethereum / ethereum/populus

Add PEP 484 type hinting to Populus

Open
#442 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
319
Forks
110
PR merge metrics
No merged PRs in 30d

Description

Proposal/suggestion: add PEP 484 type hinting to Populus.

https://www.python.org/dev/peps/pep-0484/ specifies optional type hinting, which is supported by IDEs like PyCharm, and static checkers like `mypy`.

These type hints make development quicker for those who prefer to work in IDEs, and make it much easier for new developers to get up to speed on the class APIs.

I can just maintain stub files in my own workspace, but it seems like it might be useful to add these to the project.

There are a couple ways this can be done, the simplest is just adding a `.pyi` file for every `.py` file. I created a WIP here https://github.com/ethereum/populus/pull/441 to explore what this would look like.

Another possibility would be to keep the type hints out-of-tree, perhaps in https://github.com/python/typeshed or some other repo. That seems easier to lose in a refactor.

Any thoughts/preferences on how to proceed here?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the WIP implementation in pull request #441 and the PEP 484 specification linked in the issue. Clarify whether Populus should maintain in-project .pyi files or use an out-of-tree source, then define the scope and acceptance criteria before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.