Construct-typing

Latest version: v0.6.2

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

Scan your dependencies

Page 1 of 3

2.10.66

0.6.2

- fixed error message from `EnumBase` and `FlagsEnumBase` that occures since pyright v1.1.320
- removed unnessasary `__new__` methods in `DataclassStruct`, `TEnum` and `TFlagsEnum`

0.6.1

fixed missmatch between stub and runtime type for `Array`

0.6.0

- Reworked `construct-stubs` so that it supports pyright>=v1.1.310. To support pyright and mypy in the past, `__new__` and `__init__` had to be defined. However, this is no longer supported by pyright. Now in most cases only `__init__` is defined. Only for some special cases `__new__` is used (e.g. for `FormatField`, `Const`, `Hex`, `HexDump`, `IfThenElse`, `Switch`)
- Added stubs for `cs.Compiled`.
- Added some more missing definitions (`__author__`, `__version__`, `possiblestringencodings`, `hexdump`, `hexundump`, `PY`)
- Use PEP688 buffer protocol for the `parse` method (fixes 24). This requires a dependency to typing_extensions>=4.6.0.
- `build_stream` and `build_file` do not return anything (fixes 25).

0.5.6

- Fixed python 3.11 error when using `dataclasses.asdict` for dataclasses that contains an `EnumBase` instance. (fixes 21)
- Changed `BinaryIO` to `IO[bytes]` as `StreamType`. (fixes 19)

0.5.5

- added type hints for `cs.Struct._subcons`, `cs.Sequence._subcons`, `cs.FocusedSeq._subcons`, `cs.Union._subcons`, `cs.LazyStruct._subcons`, `cs.LazyStruct._subconsindexes`
- added generic wrapper for `cs.Array`
- added `__init__` methods for all constructs that currently only define an `__new__` method
- using `__new__` instead of `__init__` for `EnumBase` to create enum member objects (fixes 18)

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.