Slyp

Latest version: v0.8.2

Safety actively analyzes 723217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.8.2

-----

- Add a ``-q/--quiet`` flag to decrease verbosity.
- Log messages printed during ``slyp`` runs are now sent to stderr.
``stdout`` is reserved for linting messages and for fixer output when running
on stdin.
- Minor bugfix to the matching AST linter: some nodes were skipped when
analyzing ``if``\s.
- Fix matching AST linter short-circuiting too early upon finding one error.

0.8.1

-----

- Bugfix: clear stale caches which could be incorrectly used in v0.8.0

0.8.0

-----

- Fix an ordering bug under libcst version 1.5.0 . New validation prevents the
generation of invalid ``if`` nodes, which ``slyp`` was generating and then
fixing. This applies to certain cases in which an ``if`` was not followed by
a space, as in ``if(x): pass``. These cases may now require two runs to
converge.
- Add fixer behavior to add a ``-> None`` return type annotation to
``__init__`` methods which have no return type annotation.

0.7.1

-----

- Fix a bug in which ``list(reversed(foo))`` was transformed to ``reversed(foo)``.
- Improve the handling of whitespace when wrapping concatenated strings

0.7.0

-----

- New autofixing behavior has been added, inspired by the rules of
flake8-comprehensions. The following autofixing behaviors are newly
added:

- Calls to ``dict()``, ``list()``, and ``tuple()`` with no arguments are replaced
with the relevant literals, ``{}``, ``[]``, and ``()``.
- Calls to ``set()`` and ``list()`` on generator expressions are converted to set
and list comprehensions.
- Calls to ``dict()`` with keyword arguments are converted to dict literal
syntax.
e.g., ``dict(x=1)`` becomes ``{"x": 1}``
- Calls to ``set()`` and ``frozenset()`` whose argument is a builtin which
produces an iterable are unwrapped.
e.g., ``set(list(foo()))`` becomes ``set(foo())``
- Calls to ``list()`` whose argument is a builtin which produces a ``list`` are
unwrapped.
e.g., ``list(sorted(foo))`` becomes ``sorted(foo)``

.. note::

The new transformation can be unsafe in certain rare cases. Specifically, the
builtin names can be rebound to user-defined callables. This would
potentially result in the fixer converting a meaningful call to these
user-defined values.

This can only occur if you rebind very well-known names,
e.g., ``def dict(...): ...``

Because there are no well-known cases in which such name shadowing is
important or essential, this is not considered a bug. Just don't shadow
these builtin names like that.
You can always disable fixing with comments for certain lines.

0.6.1

-----

- Enable autofixing of some concatenated strings which combine f-strings with
simple strings, as long as no extra escaping is needed
- Autofixing can be disabled with comments containing ``slyp: disable``,
``slyp: disable=format``, or ``fmt: off``. Inverse comments, ``slyp: enable`` and
``fmt: on`` can be used to re-enable autofixing.

Page 1 of 4

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.