Macro-kit

Latest version: v0.4.9

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

Scan your dependencies

Page 2 of 3

0.3.8

Bug fixes
----------
- Length 1 tuple `(1,)` and length 0 set `set()` was not recorded correctly.
- Import and `__all__` did not match.
- The `__getitem__` was not correctly defined when a slice is used as indices.

0.3.7

Improvements
----------------
- Fixed many typing things.
- Cythonized.

0.3.6

Changes
----------
- `Mock` object for easier `Expr` construction. Instead of writing like `Expr("getattr", [Expr("getattr", ...), b])`, you can use `m = Mock("m")` and create `Expr` object by `m.a(0, "s")`.
- Full support of Python 3.7, and add tox test.

Bug Fixes
----------
- The `__eq__` method will return False instead of raise Exception to make macro recording safer.

0.3.4

Bug Fixes
----------
- Fix incompatible annotations for Python 3.8 (and add tests).

0.3.3

New Features
---------------
- New `ast` type supports: `break`, `continue` and `raise`.
- Modules will be registered to `Symbol` whenever it is converted into a `Symbol` so that you'll not have to pass module object when you call `eval`. For instance, instead of `macro.eval({"np", np})` you only have to call `macro.eval()`.

Changes
---------
- The "type" argument in `Symbol` is removed because it is never used.

Bug Fixes
-----------
- Hash of `Symbol` was not completely safe.
- `mModule` did not return constant values correctly (such as `np.pi`).

0.3.2

New Features
---------------
- `register_type` and `Symbol.register_type` can be used as a decorator.
- `Symbol.var("x")` can create unique variable `x`.
- Many missing AST types are supported, such as `%` (mod operation), `+=` (in-place operations) and unary operations.
- Validators are implemented in `Expr` to assert correct grammar for certain header (although they are not perfect). For instance, `Expr("getattr", [Symbol("x"), "name"])` used to return `:(x.'name')` but now it returns `:(x.name)`.
- Many special methods, such as `__int__` and `__hash__`, are correctly converted to `int(X)` in macro.
- `Macro` can used as a field of a class. Unique `Macro` object will be created for different instances.

Changes
---------
- Attribute `_last_setval` is moved to `Macro`.
- Method type definition is changed to delayed definition.
- Type mapping of `symbol` now uses dictionary as much as possible.
- The `type` keyword argument in `Symbol` constructor is deleted because it was not used.

Bug Fixes
----------
- Boolean operations (`and` and `or`) could not be parsed.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.