Commit graph

56 commits

Author SHA1 Message Date
Tim Rid
a9f4b44801 fixed mypy errors 2025-01-12 15:39:57 +01:00
Tim Rid
04e1bc0c61 updated to construct==2.10.70 2025-01-12 15:35:54 +01:00
Tim Rid
f01246ae82 Since Python 3.13 the compiler now strips common leading whitespace from every line in a docstring. So this have to be fixed in the pytests. 2025-01-12 12:46:05 +01:00
Tim Riddermann
86fddbe2ac simplified "IfThenElse" 2023-07-24 10:36:28 +02:00
Tim Riddermann
ede1a72c70 added ignores, because 'Computed' is not subscriptable at runtime 2023-07-18 17:42:57 +02:00
Tim Riddermann
d9026772a0 fixed further mypy issues 2023-07-18 17:39:10 +02:00
Tim Riddermann
825783db57 fixed mypy issues 2023-07-18 17:37:29 +02:00
Tim Riddermann
7f08ab2f28 added intermediate variable, so that pyright v1.1.316 passes 2023-07-18 17:25:21 +02:00
Tim Riddermann
dd1691528f fixed pyright errors 2023-07-18 15:46:17 +02:00
Tim Riddermann
6b4a52e73a merged .py and .pyi 2023-07-18 15:44:17 +02:00
Tim Riddermann
3a676478ee fixed mypy issues 2023-05-09 11:27:19 +02:00
Tim Riddermann
ab33490dec Pickle enums by value instead of name (restores pre-3.11 behavior) to support dataclasses.asdict 2023-05-09 10:52:18 +02:00
Tim Riddermann
232fcbd725 inserted missing asserts 2023-01-06 12:00:56 +01:00
Tim Riddermann
b5add648ed fixed pyright 1.1.287 error 2023-01-06 10:45:55 +01:00
Tim Rid
916349f876 enhanced EnumBase and FlagsEnumBase to support induvidual documentation for each enum value via EnumValue 2022-12-24 12:04:45 +01:00
Tim Rid
b7e92c3c7d removed mypy error 'Unused "type: ignore" comment' 2022-12-23 20:48:05 +01:00
Tim Rid
94896208b9 fixed mypy error: error: Returning Any from function declared to return "int" 2022-10-23 22:24:08 +02:00
Tim Rid
834d244eda ignore mypy error "Call to untyped function "load" in typed context" 2022-02-13 01:14:01 +01:00
Tim Rid
2b5967e11d fixing pyright issues 2021-05-23 16:22:40 +02:00
Tim Rid
5a39c51321 - renamed classes/methods/file:
- "tstruct.py" -> "dataclass_struct.py"
    - "TStruct" -> "DataclassStruct"
    - "TBitStruct" -> "DataclassBitStruct"
    - "sfield" -> "csfield"
    - "TContainerMixin" -> "DataclassMixin"

- extended documentation
2021-05-22 23:36:54 +02:00
Tim Rid
9666d132fd added TBitStruct test 2021-05-22 21:51:24 +02:00
Tim Rid
3811437219 fixed faild test 2021-05-22 17:22:04 +02:00
Tim Rid
a304977aca - Revised TContainerMixin:
- removed inheritance of cs.Container (which removed the acces to dataclass objects via square brackets)
   - copied __str__ from cs.Container with a few modifications

- Removed 'add_offsets' from TStruct
- Changed implementation of TBitStruct
2021-05-22 17:10:56 +02:00
Tim Rid
976e68d4b9 values from "cs.Const" and "cs.Default" are now set as default value from the dataclass 2021-04-13 21:33:11 +02:00
Tim Rid
d092e48a68 fixed failing test case 2021-04-03 21:40:26 +02:00
Tim Rid
94b7f7f606 changed "swapped" to "reverse" in TStruct and TBitStruct 2021-03-30 19:54:23 +02:00
Tim Rid
b336087493 renamed "TContainerBase" to "TContainerMixin" 2021-03-30 19:35:33 +02:00
Tim Rid
ae440407e9 - renamed "TStructField" to "field" and "TUnionField" to "ufield". This makes the dataclass definitions shorter and more readable.
- removed "Opt" and "List" because they are not necessary any more, because covariant is now included for ParsedType.
- added test with typing.List as field
- fix: changed dict to typing.Dict
2021-03-16 18:51:04 +01:00
Tim Rid
d0a31458a8 added covariant and contravariant from PR #1 2021-03-13 17:49:03 +01:00
Tim Rid
318c5b0a67 arrow is now also typed, so the type ignore is unnecessary 2021-03-13 12:51:09 +01:00
Tim Rid
8957eaeede updated stubs for construct==2.10.61 2021-02-20 23:52:06 +01:00
Tim Rid
246a7d3910 added two offsets for each element 2021-02-20 22:11:10 +01:00
Tim Rid
57d843171e added __getattr__ to TStruct 2021-02-20 21:50:50 +01:00
Tim Rid
a4741e2bf2 new setting in TStruct: "add_offsets" 2021-02-20 21:42:39 +01:00
Tim Rid
419353c712 strip trailing new lines in documentation 2021-01-10 13:33:02 +01:00
Tim Rid
6900b37acd fixed things that are complained by pyright 2021-01-10 13:31:56 +01:00
Tim Rid
4c4bf74fd3 fixed some python 3.7 and numpy issues 2021-01-03 12:32:41 +01:00
Tim Rid
3d74c99718 fixed type error 2021-01-03 11:54:11 +01:00
Tim Rid
f5a3565f3e added stubs for LazyStruct, LazyListContainer, LazyArray, LazyBound
fixed bug in test_typed.py
2021-01-02 23:35:45 +01:00
Tim Rid
764102a80a Removed TArray. Instead created TypeAlias "List". 2021-01-02 22:38:18 +01:00
Tim Rid
f3a2fd94d0 fixed some mypy issues 2021-01-02 21:31:26 +01:00
Tim Rid
aa453f29a7 fixed mypy and pytest errors 2021-01-02 17:54:52 +01:00
Tim Rid
ffe3211326 added "TContainerBase" 2021-01-02 14:49:34 +01:00
Tim Rid
ac8800943a Added "TFlagsEnum" and "FlagsEnumBase" 2021-01-02 12:01:20 +01:00
Tim Rid
def9e93da7 - enhanced TEnum
- added EnumBase
- extended README.md
2021-01-02 01:12:04 +01:00
Tim Rid
74a5082c7f run black and isort 2021-01-01 23:46:43 +01:00
Tim Rid
0a51f86183 slightly modified test_core.py so that mypy doesn't generate errors. 2021-01-01 22:56:53 +01:00
Tim Rid
0f597f643f added original tests from https://raw.githubusercontent.com/construct/construct/2626b398a676191114f6ce5d8db903e9590700db/tests/test_core.py 2021-01-01 22:06:19 +01:00
Tim Rid
944cf85797 - added tests "test_tstruct_default_field" and "test_tstruct_const_field"
- added setattrs
2021-01-01 17:26:40 +01:00
Tim Rid
4aa3013a82 corrected and enhanced tests 2021-01-01 15:42:10 +01:00