Skip to content

New List results in RecursionError: maximum recursion depth exceeded in comparison #132

@hexcowboy

Description

@hexcowboy
>>> from rlp.sedes import List

>>> attrs = [
...       {
...         "trait_type": "Hat", 
...         "value": "Bayc Flipped Brim"
...       }, 
...       {
...         "trait_type": "Eyes", 
...         "value": "X Eyes"
...       },
...     ]

>>> traits = list() 
>>> for attribute in attrs:
...     properties = [attribute.get("trait_type"), attribute.get("value")]
...     trait = List(properties)
...     traits.append(trait)
... 

Results in:

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/Users/cowboy/repos/loot.st/external-adapter/venv/lib/python3.9/site-packages/rlp/sedes/lists.py", line 57, in __init__
    self.append(List(e))
  File "/Users/cowboy/repos/loot.st/external-adapter/venv/lib/python3.9/site-packages/rlp/sedes/lists.py", line 57, in __init__
    self.append(List(e))
  File "/Users/cowboy/repos/loot.st/external-adapter/venv/lib/python3.9/site-packages/rlp/sedes/lists.py", line 57, in __init__
    self.append(List(e))
  [Previous line repeated 492 more times]
  File "/Users/cowboy/repos/loot.st/external-adapter/venv/lib/python3.9/site-packages/rlp/sedes/lists.py", line 56, in __init__
    elif isinstance(e, Sequence):
  File "/Users/cowboy/.brew/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/abc.py", line 119, in __instancecheck__
    return _abc_instancecheck(cls, instance)
  File "/Users/cowboy/.brew/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/abc.py", line 123, in __subclasscheck__
    return _abc_subclasscheck(cls, subclass)
RecursionError: maximum recursion depth exceeded in comparison

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions