Commit Graph

59 Commits

Author SHA1 Message Date
Jeong YunWon
bd3d4cfdb2 earlier returning for error 2020-08-23 06:54:25 +09:00
Jeong YunWon
ab112a9adf exactly_one 2020-08-23 06:52:40 +09:00
Jeong YunWon
23c2c58140 Move out read-only flags of slots. 2020-08-21 09:47:02 +09:00
Jeong YunWon
ab37e455f3 BorrowValue for PyString 2020-08-09 14:14:55 +09:00
Jeong YunWon
a77e78d3e1 BorrowValue for bytes 2020-08-09 13:44:32 +09:00
Ben Lewis
3c5cd0d621 Code review changes. 2020-08-08 16:27:49 +12:00
Ben Lewis
386b899d82 Change error messages to match CPython's. 2020-08-08 12:52:16 +12:00
Ben Lewis
ae8d64fdd0 Fix several struct module tests. 2020-08-08 10:49:46 +12:00
Ben Lewis
7129e76d62 Implement iter_unpack 2020-08-08 08:50:40 +12:00
Ben Lewis
dc994e3c6f Accept array as byte like/buffer. 2020-08-08 08:50:40 +12:00
Ben Lewis
1fbeb80899 Implement pack_into/unpack_from in the struct module. 2020-08-08 08:50:40 +12:00
Noah
3c241cd91e Allow struct.pack to take a bytes spec 2020-07-14 21:24:41 -05:00
Aviv Palivoda
fb5862da91 Remove ThreadSafe trait 2020-05-16 13:58:10 +03:00
Aviv Palivoda
4ca4709d5a Mark PyStruct as ThreadSafe 2020-05-15 09:25:47 +03:00
Noah
aafbdd06b2 Allow struct.unpack to take a bytes 2020-04-29 11:58:19 -05:00
Jeong YunWon
06f8d0bb98 pyclass member support for #[pymodule] 2020-04-27 00:11:51 +09:00
Jeong YunWon
7cea2c3953 use #[pymodule] for stdlib struct 2020-04-27 00:11:51 +09:00
Aviv Palivoda
efb6f6a64c Implement pascal string packing 2020-03-14 17:07:38 +02:00
Aviv Palivoda
7925932459 bool packing check __bool__ 2020-03-14 16:33:13 +02:00
Aviv Palivoda
bbb799f2c7 Resize pack_string with padding 2020-03-14 16:25:02 +02:00
Aviv Palivoda
395fd6bfbe Integer packing check __index__ 2020-03-14 12:30:41 +02:00
Jeong YunWon
1c6808748e Fix struct pack and unpack 2020-03-04 11:42:17 +09:00
Jeong YunWon
197ef9cdec Fix struct.calcsize to take bytes argument 2020-03-03 19:00:56 +09:00
Noah
7f6cdc68c4 Add struct.Struct.size property 2020-02-20 23:08:37 -06:00
Noah
0dcb4d4b2e Reorganize struct module, add struct.Struct 2020-02-20 22:33:25 -06:00
Aviv Palivoda
2633f9f844 Add struct.calcsize 2020-02-06 21:21:44 +02:00
Jeong YunWon
1bac582921 &str::to_string -> &str::to_owned for literals 2020-02-05 22:55:33 +09:00
Jeong YunWon
36ebb048ef cleanup bytes 2020-01-13 11:20:42 +09:00
Jeong YunWon
70b63eb758 new_rustfunc -> new_function & new_method to distinguish bindable functions 2020-01-12 18:39:16 +09:00
Jeong YunWon
13914e0739 objstr::get_value -> objstr::clone_value
because the previous naming gives unclear performance estimation to
users especially comparing to objstr::borrow_value
2020-01-02 20:51:10 +09:00
Aviv Palivoda
d0184a7ac2 struct.pack does not allow string as pack parameter 2019-10-20 10:13:40 +03:00
ChJR
b2126829e9 Add repeat count support to struct.pack() (#1518)
* Add struct.pack() repeat count test

* Add repeat count support to struct.pack()

* Refactor parse_format_codes()

* Refactor parse_format_codes() again
2019-10-15 19:25:51 +02:00
Daniel Alley
a964f216c4 Fix clippy warnings 2019-09-26 17:45:36 -04:00
Windel Bouwman
51c3f71eed Merge pull request #1406 from lntuition/fix-1405
Fix int type casting error with negative base value
2019-09-25 17:15:48 +02:00
Sang-Heon Jeon
545e9d39df Fix int type casting error with negative base value
Change base type from u32 to PyIntRef

Fixed: #1405
2019-09-25 01:01:21 +09:00
unknown
c76739fed7 Fix Typo in vm/src/stdlib/pystruct.rs 2019-09-22 20:27:39 +09:00
coolreader18
9204035d97 Cover up bare trait objects with a dyn 2019-07-10 09:41:58 -05:00
Windel Bouwman
9e194b3904 Add endianness support to struct module. 2019-06-26 16:38:11 +02:00
Darren Kaste
a8e064b1c0 Import TypeProtocol before use in type_check! 2019-04-14 17:19:44 -04:00
Adam Kelly
9ed051e3b7 Module Initialisation takes VirtualMachine rather than PyContext. 2019-04-05 09:50:31 +01:00
coolreader18
a9051ab462 Convert all &mut VirtualMachine to &VirtualMachine 2019-03-22 01:48:14 -05:00
Joey
7bfd2e6e84 Move function items out of pyobject module 2019-03-15 21:27:11 -07:00
Adam Kelly
0ff5155af9 Rename mk_module to make_module. 2019-03-10 17:10:51 +00:00
Joey Hain
4558dbf210 Fix build (rustfmt) 2019-03-02 13:25:42 -08:00
Windel Bouwman
30ddb48037 Use PyResult at more places. 2019-03-02 14:10:46 +01:00
Windel Bouwman
c33abe91e9 Use py_module macro at more places. 2019-02-26 19:53:58 +01:00
Joey
df76ffe116 Replace most relative imports with 2018-style crate 2019-02-20 08:50:53 -08:00
ZapAnton
1043543f16 Fixed cast_lossless clippy warnings 2019-02-11 15:02:00 +03:00
Adam Kelly
fd344ec1e0 Remove unnecessary to_bigint().unwrap() everywhere. 2019-02-06 17:38:01 +00:00
Windel Bouwman
baa59ec2fc Merge branch 'master' into fix_useless_format 2019-02-06 10:50:07 +01:00