Skip to content
Merged
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/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ jobs:
path: dist/
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
uses: pypa/gh-action-pypi-publish@v1.13.0
2 changes: 1 addition & 1 deletion .github/workflows/test-pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
path: dist/
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
2 changes: 1 addition & 1 deletion src/basilisp/lang/compiler/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def format_compiler_exception( # pylint: disable=too-many-branches,unused-argum
code."""
context_exc: Optional[BaseException] = e.__cause__

lines = [os.linesep]
lines: list[str] = [os.linesep]
if context_exc is not None:
lines.append(f" exception: {type(context_exc)} from {type(e)}{os.linesep}")
else:
Expand Down
2 changes: 1 addition & 1 deletion src/basilisp/lang/compiler/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ def _wrapped_do(
) -> GeneratedPyAST[T_pynode]:
if isinstance(node, Do) and node.use_var_indirection:
with ctx.with_var_indirection_override():
return f(ctx, cast(T_node, node), *args, **kwargs)
return f(ctx, node, *args, **kwargs)
else:
with ctx.with_var_indirection_override(False):
return f(ctx, node, *args, **kwargs)
Expand Down
17 changes: 10 additions & 7 deletions src/basilisp/lang/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,11 @@ def seq(self) -> "Optional[ISeq[T]]": # type: ignore[override]
raise NotImplementedError()


T_tcoll_co = TypeVar("T_tcoll_co", bound="ITransientCollection", covariant=True)
T_tcoll = TypeVar("T_tcoll", bound="ITransientCollection")


# Including ABC as a base seems to cause catastrophic meltdown.
class IEvolveableCollection(Generic[T_tcoll_co]):
class IEvolveableCollection(Generic[T_tcoll]):
"""``IEvolveableCollection`` types support creating transient variants of persistent
data structures which can be modified efficiently and then returned back into
persistent data structures once modification is complete.
Expand All @@ -563,7 +563,7 @@ class IEvolveableCollection(Generic[T_tcoll_co]):
:lpy:fn:`transient`"""

@abstractmethod
def to_transient(self) -> T_tcoll_co:
def to_transient(self) -> T_tcoll:
raise NotImplementedError()


Expand All @@ -578,11 +578,11 @@ class ITransientCollection(Generic[T]):
__slots__ = ()

@abstractmethod
def cons_transient(self: T_tcoll_co, *elems: T) -> "T_tcoll_co":
def cons_transient(self: T_tcoll, *elems: T) -> "T_tcoll":
raise NotImplementedError()

@abstractmethod
def to_persistent(self: T_tcoll_co) -> "IPersistentCollection[T]":
def to_persistent(self: T_tcoll) -> "IPersistentCollection[T]":
raise NotImplementedError()


Expand Down Expand Up @@ -720,6 +720,9 @@ def seq_equals(s1: Union["ISeq", ISequential], s2: Any) -> bool:
return True


T_inner = TypeVar("T_inner")


class ISeq(ILispObject, IPersistentCollection[T]):
"""``ISeq`` types represent a potentially infinite sequence of elements.

Expand All @@ -733,7 +736,7 @@ class ISeq(ILispObject, IPersistentCollection[T]):

__slots__ = ()

class _SeqIter(Iterator[T]):
class _SeqIter(Iterator[T_inner]):
"""Stateful iterator for sequence types.

This is primarily useful for avoiding blowing the stack on a long (or infinite)
Expand All @@ -742,7 +745,7 @@ class _SeqIter(Iterator[T]):

__slots__ = ("_cur",)

def __init__(self, seq: "ISeq[T]"):
def __init__(self, seq: "ISeq[T_inner]"):
self._cur = seq

def __next__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/basilisp/lang/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def format_syntax_error( # pylint: disable=unused-argument

context_exc: Optional[BaseException] = e.__cause__

lines = [os.linesep]
lines: list[str] = [os.linesep]
if context_exc is not None:
lines.append(f" exception: {type(context_exc)} from {type(e)}{os.linesep}")
else:
Expand Down