Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 18, 2024
1 parent e524c02 commit 85c2d32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions thunder/core/baseutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def sequencify(x: Any) -> Sequence:
def get_module(name: str) -> Any:
return sys.modules[name]


def is_likely_from_collections_namedtuple(tuple_type):
from collections import namedtuple

Expand Down
6 changes: 4 additions & 2 deletions thunder/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,15 @@ def test_to_printable_not_collection():

def test_to_printable_collection():
from collections import namedtuple
MyTuple = namedtuple('MyTuple', ['x', 'y'])

inps = (MyTuple("abc", "def"))
MyTuple = namedtuple("MyTuple", ["x", "y"])

inps = MyTuple("abc", "def")
for inp in inps:
out = codeutils.to_printable(None, inp)
assert inp is out


#
# Type promotion tests
#
Expand Down

0 comments on commit 85c2d32

Please sign in to comment.