Add PEP484 Annotations
See original GitHub issueThe Issue
The Brownie code base does not make any use of PEP484 annotations, and sometimes variable types are changed mid-function. This makes for less readable code which can be discouraging for would-be new contributors.
Implementing annotation is an important step towards taking Brownie out of beta. It should be a multi-stage process, starting with the most developed areas of the code.
In this first step to an annotated code base, the targets are:
Completion Goals
- Running MyPy with the following configuration file should complete without any errors.
[mypy]
disallow_untyped_defs = True
ignore_missing_imports = True
follow_imports = silent
files = brownie/*.py,brownie/network,brownie/project
-
API Documentation must be updated. Each function should include the same annotations as the source code. The following files will require updating:
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
PEP 484 – Type Hints - Python Enhancement Proposals
PEP 3107 added support for arbitrary annotations on parts of a function definition. ... This PEP aims to provide a standard syntax for...
Read more >PEP-484 Type Annotations with own types - Stack Overflow
But for your specific case, the short answer is that in PEP484 realm you can work with own types in 4 ways: just...
Read more >Add type hints (PEP 484) and variable annotations (PEP 526)
Adhering to Type hints(PEP 484) / type annotations could contribute to being more explicit / performing code analysis and checks on Django projects....
Read more >Generate PEP 484 type annotations from docstrings - GitHub
Generate PEP 484 type annotations from docstrings. ... A more complex example demonstrates some of the added readability that comes from specifying types ......
Read more >Type hinting in PyCharm - JetBrains
PyCharm supports type hinting in function annotations and type comments ... supports all methods for adding types supported in PEP 484, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@iamdefinitelyahuman thanks for the opportunity to contribute to this project. I’ll get started with a work in progress pull request shortly to continue the discussion there. Looking forward to working with you.
Thanks @crawfordleeds !