Scell

Latest version: v0.3.1

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

Scan your dependencies

0.3.0

**Revamped the Scell API to embrace immutable objects**
`Monitored` objects are now assumed to be immutable and the user/library code will not alter them in any way. Instead of mutating the `readable` and `writable` attributes which are not inherently thread safe, `Event` objects are emitted when selecting, which are lightweight wrappers over the readability/writability of the monitored file objects.

**Removed some methods from the Selector class**
In order to make the API more lightweight, typically unused methods such as `Selector.only` are removed. Instead, a **`Selector.scoped`** method is added which allows one to write code like:

python
with selector.scoped([fp1,fp2]) as [m1, m2]:
m1.callback = lambda: 1
m2.callback = lambda: 2
[ev.callback() for ev in selector.select()]


**Less primitive oriented code**
The `Monitored` objects no longer support mode-strings, i.e. `rw`, `r`, etc. Instead, the intended meaning is "injected" by the `Selector` class, i.e. the mode-string is parsed by the selector, which in part encourages immutability as well.

0.2.2

Fixes documentation and some issues.

0.1.0

0.0.2

Refactored the codebase:
- Made `Selector` a subclass of `dict`
- Use more generic methods
- Included `Selector.only` method

0.0.1

The initial release for Scell.

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.