Commit Graph

61 Commits

Author SHA1 Message Date
Jeong Yunwon
09fc676164 Use static ref 2022-05-30 07:38:33 +09:00
Kangzhi Shi
3e6e348a67 impl number protocol float 2022-05-30 07:36:08 +09:00
Jeong Yunwon
6d0abe6915 mapping proxy holds PyMapping 2022-05-29 07:45:52 +09:00
Jeong Yunwon
83a146d8c8 AsMapping only with static reference 2022-05-29 02:33:30 +09:00
Jeong Yunwon
97c2d187f6 AsMapping::AS_MAPPING 2022-05-28 01:42:06 +09:00
Jeong Yunwon
fb52694e41 PyAttributes key is PyStrInterned 2022-05-23 09:03:13 +09:00
Jeong Yunwon
251ce4e68e ArgByteOrder 2022-05-04 08:29:15 +09:00
Jeong Yunwon
a50ca743dc empty vm/functin/mod.rs 2022-05-04 08:29:15 +09:00
Jeong Yunwon
24186558ed Deref for ArgIntoComplex 2022-04-29 10:51:25 +09:00
Jeong Yunwon
84e2b52240 Deref for ArgIntoFloat 2022-04-29 10:47:59 +09:00
Jeong Yunwon
9f17a50c60 Impl std::ops::Deref for ArgIntoBool 2022-04-29 10:34:26 +09:00
Jeong Yunwon
37daf188ca Use option-like operator for OptionalArg 2022-04-29 10:07:02 +09:00
Jeong Yunwon
a7135024a5 &PyTuple and &PyTupleRef works like &[PyObjectRef] 2022-04-24 12:26:48 +09:00
Jeong Yunwon
dd3d3ef55b Replace as_slice of trait impl with AsRef<[T]> 2022-04-24 12:26:48 +09:00
Jeong Yunwon
0535077631 either is a function utility 2022-04-23 20:49:31 +09:00
Jeong Yunwon
a05a09390e pyobject to object 2022-04-23 08:57:30 +09:00
Jeong Yunwon
66b6a06997 PyValue -> PyPayload 2022-04-23 05:20:31 +09:00
Jeong Yunwon
554b2b9f48 vm/src/function/builtin.rs 2022-04-19 01:25:36 +09:00
Jeong Yunwon
abe3d6bc8e vm/src/function/argument.rs 2022-04-19 01:19:16 +09:00
Jeong Yunwon
af84587543 vm::function::{argument => protocol}.rs 2022-04-19 01:07:38 +09:00
Jeong Yunwon
860d7e1562 inline and cold 2022-04-19 01:00:15 +09:00
Jeong Yunwon
c4b80b3a24 IntoObject::into_object() and PyValue::into_pyobject(vm) 2022-04-19 00:38:18 +09:00
Jeong Yunwon
fee3bf2722 AsPyObject -> AsObject because fn as_object 2022-04-18 07:19:35 +09:00
Jeong Yunwon
e356d51af1 move ToPy* to convert 2022-04-18 07:17:24 +09:00
Jeong Yunwon
f6d70c8176 Into{PyObject,PyException,Pyresult} -> To{..}
The naming convention was wrong
2022-04-18 06:04:47 +09:00
Jeong Yunwon
aa76a34963 merge TypeProtocol in AsPyObject 2022-04-17 19:26:10 +09:00
Jeong Yunwon
935bfcda86 inline for object pointer operations 2022-04-17 10:37:53 +09:00
Jeong Yunwon
625f8675ae Introduce AsPyObject to replace IdProtocol 2022-04-17 10:32:01 +09:00
Jeong Yunwon
dca59e9832 Add borrow for wrapping types 2022-04-17 09:40:39 +09:00
Jeong Yunwon
828c28ebb8 Replace vm.extract_elements with TryFromBorrowedObject 2022-04-17 06:09:45 +09:00
Jeong Yunwon
86a8831124 vm::funciton::arithmetic 2022-04-16 00:49:05 +09:00
Jeong Yunwon
3629ce5cd7 rename non-protocol PySequence to ArgSequence to avoid confusion 2022-04-14 03:26:38 +09:00
Kangzhi Shi
7bc2d0e1c0 fix PySequenceIterator to use sequence protocol 2022-03-12 16:12:12 +09:00
Kangzhi Shi
ca4e8f50e8 refactor ItemProtocol -> Object Protocol 2021-11-27 13:00:37 +02:00
Steve Shi
742ea0c4fa Reimpl Buffer Protocol and memoryview support ndarray with shape, stride and suboffset (#3340)
* Fix buffer protocol and memoryview

* Fix io and array the right way to use buffer protocol

* fix rebase

* fix memoryview and introduce VecBuffer

* fix deadlock

* fix memoryview avoid double release buffer

* impl ndim buffer support

* first implement nd array for buffer and memoryview

* fix slice adjust_indices

* fix adjust_indices introduct SaturatedSliceIterator

* fix memoryview cmp

* fix adjust_indices positive_order

* fix bug mark passed test

* fix clippy

* fix set_item_slice deadlock, optimize buffer

* Delete @test_113974_tmp

* Remove vec_buffer_type

* rusty names

* impl memoryview multi index

* add comments

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2021-11-13 07:17:11 +02:00
Jeong YunWon
b759808736 PyObj -> PyObject 2021-10-21 17:55:29 +09:00
Noa
8dd18d97be PyObjectRef -> &PyObj, &PyRef<T> -> &Py<T> 2021-10-21 16:49:01 +09:00
Jeong YunWon
7cae6d24fe Refactor PyType creation 2021-10-14 13:37:45 +09:00
Jeong YunWon
c83eb12d0a Merge pull request #3258 from youknowone/ascii-buffer
ArgAsciiBuffer
2021-10-09 16:27:47 +09:00
Jeong YunWon
4fb1cdb316 PyObjectWrap 2021-10-08 01:56:00 +09:00
Ben Lewis
48e5feb994 Add AsciiBytesLike to accept both an ascii string or a buffer. 2021-10-07 23:23:32 +09:00
Jeong YunWon
04e25e8d2d vm/function/{byteslike -> buffer}.rs
those types are buffer utilities
byteslike is one of them
2021-10-07 23:19:37 +09:00
Jeong YunWon
6ba322f261 clean up byteslike api 2021-10-07 23:18:35 +09:00
jfh
c0420721e0 Rename from ArgTypeLike to ArgIntoType, numlike to number. 2021-10-07 15:30:57 +03:00
jfh
a29f9452b8 Add documentation for Arg types. 2021-10-07 14:12:47 +03:00
jfh
b2a2238566 Add ArgBoolLike. 2021-10-07 12:56:01 +03:00
jfh
856f77fb77 Add ArgFloatLike. 2021-10-07 12:34:30 +03:00
jfh
acfdf9ceaa Move try_complex into PyObjectRef 2021-10-07 12:23:12 +03:00
jfh
7387324f59 Add ArgComplexLike 2021-10-07 12:06:26 +03:00
Jeong YunWon
0c56761be1 flexible PyIterIter and PyIter::into_iter 2021-10-04 04:53:46 +09:00