Sain

Latest version: v1.1.0

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

Scan your dependencies

Page 1 of 2

1.1.0

Added

- `conversion` interfaces `Into`, `From`, `TryInto` and `TryFrom`.
- `count`, `index` and `sort` methods to `Vec`.
- `macos` alias to `darwin` for `target_os`.
- `ios` support to `target_os`.
- impl `Bytes`

Changed

- starting from this release, all collections are moved to `collections` instead of being in top-level.
of course, core implementations such as `Vec` are still at top level.

09/06/2024

Added

- `MaybeUninit[T]` type.
- `Iterator` interface which represents `Iterator` trait in Rust
- Default external adapters for `Iterator`.
- `Vec.push_within_capacity`
- `Vec.reserve`
- `Some.take_if`
- `iter.repeat`

Changed

- `Option.take` now return `Option[T]` instead of `None`
- Stabilized `Vec.with_capacity` and its fellow methods.
- Calling `RefCell.copy` now increment its ref count when called.
- The repr of `Some(None)` is now `None` instead of `Some(None)`
- Passing a `list` variable when constructing a `Vec` now will point to that list instead of copying it.
- Better documentation on `Vec`
- `vec.vec` is renamed to `vec.from_args`
- `iter.empty` now returns `Empty[T]` instead of `Iter[Never]` with better type hinting.
- Better `repr` for iterators.
- Changed the default value of `Some` from `NoneType` to `Some(None)`

0.0.6

Added

- `doc` decorator.
- The `Result` type including `OK` and `Err`.
- `Vec[T]` type.
- `Error` type.
- `Box[T]` type. This is not the same as rust's `Box`, Check the object documentation.
- `sync` package which contains the following modules. they're object safe.
- `lazy.Lazy[T]` and `lazy.LazyFuture[T]`.
- `once.AsyncOnce[T]` and `once.Once[T]`.
- `Iter.sink` method.
- `RefCell` received two methods, `increment` and `decrement` which increments the ref count of the object its holding.

Changed

- Iterating over `Iter` object with `for` doesn't return `Option[T]` anymore.
- Type hint `Option` isn't required to be under `TYPE_CHECKING` anymore.
- `futures.spawn` now returns `Result[T, E]` and doesn't raise.
- `Iter.async_for_each` now returns `Result[T, E]` and doesn't raise.
- `ref.AsRef` is now `cell.Cell`, `ref.AsMut` is now `cell.RefCell`.

0.0.5

Added

- `Once` type.
- `Iter.next` now returns `sain.Option[T]` instead of `typing.Optional[T]`.
- `.copied`, `by_ref`, `.async_for_each` methods to the `Iter`.
- `empty` function in `sain.iter` module.
- `once` function in `sain.iter` module.
- `Some.iter` method to the `Some` object.
- `option.NOTHING` default constant.

Removed

- method `Iter.discard` in favor of `Iter.filter` method.

Changed

- `casting` parameter in `Iter.collect` renamed to `cast`.

0.0.4

Added

- New decorators defined in module `macros.py`
- `todo`
- `unimplemented`
- `deprecated`
- `futures` module which exports usefull functions for `async` programming.
- `Some.unwrap_unchecked` method.

Changed

- Python `3.10+` is now required to install sain.
- Use the `collections.abc` and `builtins` for the standard types.
- You need to import `__futures__ annotations` to use `Option<T>` type hint, You also need to import it under `TYPE_CHECKING`.
- Project tree restructure.
- The `Drop` check is now deprecated and no longer can be used.
- The standard types not do not inherit from `Default<T>`
- Drop `pkg_resources` module for `__import__` during `requires_modules` attrs check..

Removed

- The `Drop` protocol from top-level.

0.0.3

Added

- Examples
- Proper documentation.
- `Drop` protocol and `drop` function.
- `RefMut` type and `as_mut`.
- Tests
- `Default` is now slotted
- `.pyi` stubs.

Changed

- The `Some` type `__str__` now returns `Some(repr(value))` instead of just `repr(value)`.
- `Ref` now supports `__hash__`.
- `target_os` no accepts `windows` as an alias to `win32`.

Removed

- `Some.is_none_and` method since it made no sense.

Fixed

- `sain.cfg()` wasn't working correctly.

0.0.2

Addeed

- A type alias `Option[T]` for `Some[T]`.

Changed

- Export modules to top level.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.