Commit graph

70 commits

Author SHA1 Message Date
Tim Riddermann
c04a90575d use PEP688 buffer protocol for "parse" Method (fixes #24) 2023-07-24 10:57:50 +02:00
Tim Riddermann
c6bded59f4 fixes #25 2023-07-24 10:56:37 +02:00
Tim Riddermann
86fddbe2ac simplified "IfThenElse" 2023-07-24 10:36:28 +02:00
Tim Riddermann
26f7fd82dc removed unnessesary comment 2023-07-24 10:14:33 +02:00
Tim Riddermann
86f27dc1fb use method-scoped TypeVars for __new__ (see here https://github.com/microsoft/pyright/issues/5404#issuecomment-1645764913) 2023-07-24 09:40:50 +02:00
Tim Riddermann
3c81d99c12 Added __new__ only where it is an absolute must have. 2023-07-18 17:36:27 +02:00
Tim Riddermann
f75029247f added missing definitions 2023-07-18 17:26:03 +02:00
Tim Riddermann
1e7ced992d removed all self type annotations of __init__ methods 2023-07-18 15:38:01 +02:00
Tim Riddermann
dcdeeca39f removed all __new__ methods. mypy v1.4.1 is working. 2023-06-30 14:13:01 +02:00
Tim Riddermann
6550e59dd3 added missing __new__ methods 2023-06-30 13:06:29 +02:00
Tim Riddermann
2200a0a8d0 fixed mypy errors 2023-05-09 12:31:38 +02:00
Tim Riddermann
bb3935e7eb fixes #19 2023-05-09 12:27:46 +02:00
Tim Riddermann
238ca5d2df removed not working __init__ 2023-01-06 12:05:14 +01:00
Tim Riddermann
7f6577af47 added __init__ methods for all that currently only defined an __new__ method 2023-01-06 12:00:42 +01:00
Tim Riddermann
f98532a382 fixed _subconsindexes 2023-01-06 10:35:07 +01:00
Tim Riddermann
31a10dcc88 added type hints for Struct._subcons, Sequence._subcons, FocusedSeq._subcons, Union._subcons, LazyStruct._subcons, LazyStruct._subconsindexes 2023-01-06 10:32:19 +01:00
Tim Rid
349c8e5dd2 Updated IfThenElse so that it represents the real implementation 2022-12-23 20:37:05 +01:00
Tim Rid
e10938f308 Added type hint to self type, for mypy support. 2022-10-24 00:07:57 +02:00
Tim Rid
2b780ae7b9 changed Adapter __new__ to __init__ to fix #13. But this change on Adapter also reqires to change other Adapter subclasses. 2022-10-23 23:49:58 +02:00
Tim Rid
a03190d816 fixed some pyright/pylance issues 2022-10-23 22:48:42 +02:00
Tim Rid
29d2608c37 fixed BuildTypes of cs.Const 2022-02-13 01:06:45 +01:00
Parnassius
0979257dd7 Use os.PathLike for file names 2022-01-07 12:27:46 +01:00
Tim Rid
a71b040847 fixed IfThenElse for pyright 2021-10-23 12:54:43 +02:00
Tim Rid
0e9fb3a497 added stub for evaluate 2021-07-31 13:59:48 +02:00
Tim Rid
e377951b8f fixed Switch.default 2021-07-31 13:59:32 +02:00
Tim Rid
334e13c630 enhance cs.Checksum see #3 2021-07-19 20:41:41 +02:00
Tim Rid
2b5967e11d fixing pyright issues 2021-05-23 16:22:40 +02:00
Tim Rid
b43a4840ac Fixed "encmapping" of "Enum". Every string can be used as key 2021-04-29 15:50:49 +02:00
Tim Rid
845af16b4a Updated to construct==2.10.66 2021-04-03 21:35:57 +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
667ee5c7d3 changed "typing.ByteString" to "bytes" in the annotations, because it is equivalent according to the documentation of "typing.ByteString". 2021-03-13 13:00:43 +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
6900b37acd fixed things that are complained by pyright 2021-01-10 13:31:56 +01:00
Tim Rid
703d5a8638 added missing attributes of the constructs 2021-01-04 21:26:23 +01:00
Tim Rid
4c4bf74fd3 fixed some python 3.7 and numpy issues 2021-01-03 12:32:41 +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
74a5082c7f run black and isort 2021-01-01 23:46:43 +01:00
Tim Rid
fb38301189 fixed stub for NamedTuple 2021-01-01 22:55:48 +01:00
Tim Rid
ede0840a0b Fixed TStruct in TArray 2021-01-01 13:55:19 +01:00
Tim Rid
ecb403b50b added value to Const and Default 2020-12-31 00:31:15 +01:00
Tim Rid
f024524b66 - replaces BufferType with typing.ByteString
- fixed stubs of Const
- changed __init__ to __new__ on ExprAdapter, ExprSymmetricAdapter, ExprValidator
2020-12-30 23:10:41 +01:00
Tim Rid
c0b0c7a3ab - added stubs for Tunnel, Compressed, Rebuffered
- added __getattr__ for Struct, Sequence, FocusedSeq, Union
2020-12-29 20:59:53 +01:00
Tim Rid
3e388ef1a6 added stubs for ProcessXor, ProcessRotateLeft, Checksum 2020-12-29 20:14:32 +01:00
Tim Rid
e357050dbe changed __init__ to __new__ of FlagsEnum 2020-12-29 19:11:03 +01:00
Tim Rid
5b6c312ba4 added stubs for OneOf, NoneOf, Filter, Slicing, Indexing 2020-12-29 17:43:32 +01:00
Tim Rid
06f37c3e1d - added missing variables to "Construct" class
- fixed __rtruediv__ of "Construct" class
2020-12-29 14:37:21 +01:00
Tim Rid
1b077ed18f - added stubs for stream access
- removed Optional from the "Context" class, and added comments instead
- added stub for Lazy
2020-12-29 14:13:24 +01:00
Tim Rid
a4b16ed338 changed __init__ to __new__ in Array, GreedyRange, NamedTuple
fixed stub for Switch
2020-12-29 13:10:25 +01:00