Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
pip install -e .

- name: Run test suite
run: pytest
run: pytest -v

18 changes: 15 additions & 3 deletions a_sync/iter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ class ASyncIterable(_ASyncIterable):
else:
args = (arg_or_args,)
return _class_getitem(cls, args)
return super().__class_getitem__(arg_or_args, **kwargs)

if hasattr(cls, "__parameters__"):
return super().__class_getitem__(arg_or_args, **kwargs)
else:
return cls


cdef class _ASyncIterator(_AwaitableAsyncIterableMixin):
Expand Down Expand Up @@ -429,7 +433,11 @@ class ASyncIterator(_ASyncIterator):
else:
args = (arg_or_args,)
return _class_getitem(cls, args)
return super().__class_getitem__(arg_or_args, **kwargs)

if hasattr(cls, "__parameters__"):
return super().__class_getitem__(arg_or_args, **kwargs)
else:
return cls


class ASyncGeneratorFunction(Generic[P, T]):
Expand Down Expand Up @@ -795,7 +803,11 @@ class ASyncSorter(_ASyncSorter):
else:
args = (arg_or_args,)
return _class_getitem(cls, args)
return super().__class_getitem__(arg_or_args, **kwargs)

if hasattr(cls, "__parameters__"):
return super().__class_getitem__(arg_or_args, **kwargs)
else:
return cls


@lru_cache(maxsize=None)
Expand Down
Loading