Cantok

Latest version: v0.0.31

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

Scan your dependencies

Page 1 of 5

0.0.31

A micro-change.

- Now the method `.wait()` for any token will work correctly in `REPL`.

0.0.30

Microscopic change.

- Now the `repr` for `ConditionToken` works not only with ordinary functions, but also with objects that have the `__call__` method.

0.0.29

A small update, but recommended.

- The operation of summing two timeout tokens is optimized. Now, in some cases, the token with an earlier expiration will remain alone.

0.0.28

A useful little update.

- Text representations of various tokens are now shorter and more beautiful.
- Added a new optimization: now, if possible, the token sum operation does not create an additional `SimpleToken`. Due to this, the token graph becomes smaller and all operations on it are faster.

0.0.27

Purely stabilization update, the library's capabilities have not changed at all.

- Added some new tests.
- Improved code examples in the documentation: added output comments.

0.0.26

An important update dedicated to internal optimizations. The token interfaces have not changed in any way.

- Each token now caches information that one of the tokens embedded in it has been canceled. When the token status is requested again, it will not bypass the graph, but will immediately return the result.
- Added an optimization of the token summation operation: now, if you add a `SimpleToken()` object that has not been saved to any variable to any another token, this object will be ignored. Thus, the token tree becomes smaller. That is, the operation `SimpleToken() + TimeoutToken(5)` now gives the result `SimpleToken(TimeoutToken(5))`, not `SimpleToken(SimpleToken(), TimeoutToken(5))` like before. In addition, this leads to the fact that the sums of more than 3 tokens become "flat".
- Fixed a bug where you could set the `cancelled` attribute of a token whose nested token was canceled to `False`.
- Added the `__slots__` attribute to the cancellation report object. This allowed you to save an extra 8 bytes on each such object, provided that you have Python 3.10 or later.
- Type hints slightly improved. The file structure of the project is now more extensive. The package metadata was slightly expanded.

Page 1 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.