question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add PEP484 Annotations

See original GitHub issue

The 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

  1. 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
  1. 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:closed
  • Created 4 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Aug 19, 2019

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

0reactions
iamdefinitelyahumancommented, Sep 13, 2019

Thanks @crawfordleeds !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found