You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Library Version: [Versão da biblioteca, se aplicável]
Description of the Issue
When running tests using Python 3.8, a TypeError is encountered in the MerkleTree class, specifically in the human_leaves and human_short_leaves properties. This issue does not occur in Python 3.9 or 3.10, indicating it's likely related to type hinting compatibility with Python 3.8.
Error Message
TypeError: 'type' object is not subscriptable
This error occurs when collecting tests that import and use the MerkleTree class.
Steps to Reproduce
Set up a Python 3.8 environment.
Run pytest on the codebase.
Observe the TypeError in the collection phase of the pytest.
Expected Behavior
The MerkleTree class should function correctly without type errors across different Python versions, especially in supported versions like Python 3.8.
Actual Behavior
A TypeError is raised due to the use of Python 3.9+ style list type hints (e.g., list[str]) which are not compatible with Python 3.8.
Possible Solution
Replace the Python 3.9+ list type hints with the Python 3.8 compatible format using the typing module. For instance, change:
Environment
Description of the Issue
When running tests using Python 3.8, a
TypeError
is encountered in theMerkleTree
class, specifically in thehuman_leaves
andhuman_short_leaves
properties. This issue does not occur in Python 3.9 or 3.10, indicating it's likely related to type hinting compatibility with Python 3.8.Error Message
TypeError: 'type' object is not subscriptable
This error occurs when collecting tests that import and use the
MerkleTree
class.Steps to Reproduce
TypeError
in the collection phase of the pytest.Expected Behavior
The
MerkleTree
class should function correctly without type errors across different Python versions, especially in supported versions like Python 3.8.Actual Behavior
A
TypeError
is raised due to the use of Python 3.9+ style list type hints (e.g.,list[str]
) which are not compatible with Python 3.8.Possible Solution
Replace the Python 3.9+ list type hints with the Python 3.8 compatible format using the
typing
module. For instance, change:to
and similarly for human_short_leaves.
The text was updated successfully, but these errors were encountered: