Spans

Latest version: v1.1.0

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

Scan your dependencies

Page 1 of 3

1.1.0

-------------
Released on 2nd June, 2019

This release changes a lot of internal implementation details that should
prevent methods from not handling unbounded ranges correctly in the future.

- Added validation to ensure unbounded ranges are never inclusive
- Changed ``__repr__`` for ranges to be more similar to proper Python syntax.
The old representation looked like mismatched parentheses. For instance
``floatrange((,10.0])`` becomes ``floatrange(upper=10.0, upper_inc=True)``
- Dropped Python 3.3 support since it's been EOL for almost two years. It
probably still works but it is no longer tested
- Fixed pickling of empty range sets not working
(`bug 14 <https://github.com/runfalk/spans/issues/14>`_)
- Fixed :meth:`~spans.types.Range.union` not working properly with unbounded
ranges
- Fixed lowerly unbounded ranges improperly being lower inclusive
- Fixed :meth:`~spans.types.Range.startswith` and
:meth:`~spans.types.Range.endsbefore` being not handling empty ranges

1.0.2

-------------
Released on 22th February, 2019

- Fixed :meth:`~spans.types.Range.union` when ``upper_inc`` is set to ``True``
(`bug 11 <https://github.com/runfalk/spans/issues/11>`_,
`Michael Krahe <https://github.com/der-michik>`_)

1.0.1

-------------
Released on 31st January, 2018

- Fixed ``PartialOrderingMixin`` not using ``__slots__``
(`bug 10 <https://github.com/runfalk/spans/issues/10>`_)

1.0.0

-------------
Released on 8th June, 2017

- Added ``NotImplemented`` for ``<<`` and ``>>`` operators when there is a type
mismatch
- Added ``|`` operator for unions of :class:`~spans.types.Range` and
``NotImplemented`` support for :class:`~spans.settypes.RangeSet`
- Added ``&`` operator for intersections of :class:`~spans.types.Range` and
``NotImplemented`` support for :class:`~spans.settypes.RangeSet`
- Added ``-`` operator for differences of :class:`~spans.types.Range` and
``NotImplemented`` support for :class:`~spans.settypes.RangeSet`
- Added ``reversed()`` iterator support for :class:`~spans.types.DiscreteRange`
- Fixed overlap with empty range incorrectly returns ``True``
(`bug 7 <https://github.com/runfalk/spans/issues/7>`_)
- Fixed issue with :meth:`~spans.types.Range.contains` for scalars on unbounded
ranges
- Fixed type check for :meth:`~spans.types.Range.right_of`
- Fixed type check for :meth:`~spans.settypes.RangeSet.contains`
- Fixed type check for :meth:`~spans.settypes.RangeSet.union`
- Fixed type check for :meth:`~spans.settypes.RangeSet.intersection`
- Fixed type check for :meth:`~spans.settypes.RangeSet.difference`
- Fixed infinite iterators not being supported for
:class:`~spans.types.DiscreteRange`

0.5.0

-------------
Released on 16th April, 2017

This release is a preparation for a stable 1.0 release.

- Fixed comparison operators when working with empty or unbounded ranges. They
would previously raise exceptions. Ranges are now partially ordered instead of
totally ordered
- Added more unit tests
- Renamed classes to match :pep:`8class-names` conventions. This does not apply
to classes that works on built-in that does not follow :pep:`8class-names`.
- Refactored :meth:`~spans.types.Range.left_of`
- Refactored :meth:`~spans.types.Range.overlap`
- Refactored :meth:`~spans.types.Range.union`

0.4.0

-------------
Released on 20th March, 2017

This release is called 0.4.1 on PyPI because I messed up the upload.

- Added new argument to :meth:`~spans.types.daterange.from_date` for working
with different kinds of date intervals. The argument accepts a period of either
``"day"`` (default), ``"week"`` (ISO week), ``"american_week"`` (starts on
sunday), ``"month"``, ``"quarter"`` or ``"year"``.
- Added new methods to :class:`~spans.types.daterange` for working with different
kinds of date intervals:
:meth:`~spans.types.daterange.from_week`,
:meth:`~spans.types.daterange.from_month`,
:meth:`~spans.types.daterange.from_quarter` and
:meth:`~spans.types.daterange.from_year`.
- Added a new class :class:`~spans.types.PeriodRange` for working with periods
like weeks, months, quarters or years. It inherits all methods from
:class:`~spans.types.daterange` and is aware of its own period type. It
allows things like getting the previous or next week.
- Fixed :class:`~spans.types.daterange` not accepting subclasses of ``date``
(`bug 5 <https://github.com/runfalk/spans/issues/5>`_)
- Fixed some broken doctests
- Moved unit tests to `pytest <http://docs.pytest.org/en/latest/>`_
- Removed `Tox <https://tox.readthedocs.io/en/latest/>`_ config
- Minor documentation tweaks

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.