Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hints and clean up ABI code #253

Merged
merged 30 commits into from
Nov 24, 2021
Merged

Conversation

algochoi
Copy link
Contributor

@algochoi algochoi commented Nov 24, 2021

This PR aims to do some refactoring and clean up so the ABI code has type hints, change some relative imports to absolute imports and makes some minor documentation changes to reflect the newer design.

I also opted to use forward references in some places because we are still on 3.5 for now.

@algochoi algochoi self-assigned this Nov 24, 2021
@algochoi algochoi requested a review from tzaffi November 24, 2021 16:39
@algochoi algochoi marked this pull request as ready for review November 24, 2021 16:39
Copy link
Contributor

@jasonpaulos jasonpaulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement, but please consider replacing instances of list with List[<the element type>] for further type support. I believe a plain list is equal to List[Any].

You can import List from the typing module.

algosdk/abi/address_type.py Outdated Show resolved Hide resolved
algosdk/abi/util.py Outdated Show resolved Hide resolved
algosdk/abi/tuple_type.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tzaffi tzaffi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am approving the PR as I don't have any beef with it being merged as is. None of my suggestions are mandatory.

@algochoi algochoi merged commit 0f521d0 into develop Nov 24, 2021
@algochoi algochoi deleted the algochoi/abi-type-hints branch November 24, 2021 21:11
aldur pushed a commit that referenced this pull request Feb 8, 2022
* Add type hints and clean up ABI types

* Change relative imports to absolute imports

* Add type hints for ABI objects

* Refactor composer with type hints

* Address PR comments, change list type hints, and move type_from_string to ABIType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants