a set of abstraction of Rust's core crates for Python 🦀
BSD-3-CLAUSE License
Bot releases are visible (Hide)
sain.collections.HashMap
Bytes.chars
Bytes.as_ptr
Iterator.collect_into
Option.insert
Option.get_or_insert
Option.get_or_insert_with
Option.ok_or
Option.ok_or_else
Option.zip
Option.zip_with
Option.inspect
nothing_unchecked
calls from methods that return Option[T]
by replacing with NOTHING
constant.MaybeUninit
no longer exported to top level.Option.into_inner
renamed to Option.transpose
Lazy
and LazyFuture
now take a closure that initialize the value at first access.set
manually.Bytes.as_bytes
to Bytes.to_bytes
Option.as_ref
Option.as_mut
Cell
and RefCell
Published by nxtlo 4 months ago
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
.Bytes
collections
instead of being in top-level.Vec
are still at top level.Published by nxtlo 4 months ago
MaybeUninit[T]
type.Iterator
interface which represents Iterator
trait in RustIterator
.Vec.push_within_capacity
Vec.reserve
Some.take_if
iter.repeat
Option.take
now return Option[T]
instead of None
Vec.with_capacity
and its fellow methods.RefCell.copy
now increment its ref count when called.Some(None)
is now None
instead of Some(None)
list
variable when constructing a Vec
now will point to that list instead of copying it.Vec
vec.vec
is renamed to vec.from_args
iter.empty
now returns Empty[T]
instead of Iter[Never]
with better type hinting.repr
for iterators.Some
from NoneType
to Some(None)
Published by nxtlo 6 months ago
@doc
decorator.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.Iter
object with for
doesn't return Option[T]
anymore.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
.Published by nxtlo 9 months ago
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__
and Some.iter
methods to the Some
object.option.NOTHING
default constant.Iter.discard
in favor of Iter.filter
method.casting
parameter in Iter.collect
renamed to cast
.Published by nxtlo about 1 year ago
macros.py
todo
unimplemented
deprecated
futures
module which exports usefull functions for async
programming.Some.unwrap_unchecked
method.3.10+
is now required to install sain.collections.abc
and builtins
for the standard types.__futures__ annotations
to use Option<T>
type hint, You also need to import it under TYPE_CHECKING
.Drop
check is now deprecated and no longer can be used.Default<T>
pkg_resources
module for __import__
during requires_modules
attrs check..Drop
protocol from top-level.Published by nxtlo over 2 years ago
Drop
protocol and drop
function.RefMut
type and as_mut
.Default
is now slotted.pyi
stubs.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
.Some.is_none_and
method since it made no sense.sain.cfg()
wasn't working correctly.Published by nxtlo over 2 years ago
Option[T]
for Some[T]
.Published by nxtlo over 2 years ago
Some[T]
, Default[T]
, Ref[T]
, Iter[T]
types.cfg
was always returning True
.