Commit Graph

32 Commits

Author SHA1 Message Date
Jeong Yunwon
0535077631 either is a function utility 2022-04-23 20:49:31 +09:00
Jeong Yunwon
e52a5f99f3 remove PyPayload::into_pyresult_with_type 2022-04-23 09:47:53 +09:00
Jeong Yunwon
66b6a06997 PyValue -> PyPayload 2022-04-23 05:20:31 +09:00
Jeong Yunwon
1b5348a7f4 Fix _socket.socket naming 2022-04-19 15:07:04 +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
a22341787a remove socket.IPPROTO_MAX 2022-04-18 00:23:23 +09:00
Jeong Yunwon
75e589cbc1 isinstance -> fast_isinstance 2022-04-17 20:32:34 +09:00
Jeong Yunwon
aa76a34963 merge TypeProtocol in AsPyObject 2022-04-17 19:26:10 +09:00
Jeong Yunwon
6357a1acbe clean up imports and useless allow attributes 2022-04-15 23:58:20 +09:00
hwi-ya
dcbaecab9a add missing constants 2022-04-10 10:20:04 +09:00
jeon-yongjun
aa8a3afb81 Add missing constants 2022-04-09 21:00:32 +09:00
himmelmin
735856fabc Add missing constants 2022-04-09 19:29:51 +09:00
simbajisu
6117d3ab5a add missing constants 2022-04-09 17:07:45 +09:00
Padraic Fanning
88e0f13993 Fix unnecessary_lazy_evaluations Clippy warning 2022-02-25 19:33:52 -05:00
snowapril
ab1693e131 Replace new_class to new_exception_type
Replace `new_class` method call for module-level exceptions to newly
added `new_exception_type`

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-11-12 21:40:26 +09:00
snowapril
5e8d3bcacb Remove duplicated static_cell! stmts in each modules
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-11-12 21:40:26 +09:00
David Carlier
d6e89301a5 netbsd/openbsd build fix 2021-11-07 12:48:34 +00:00
Daniel Watkins
9dce9bf0b9 correctly set __module__ and __name__ for builtin exceptions
In CPython's PyErr_NewException[0], the dotted "module.name" passed in is
split on that dot: the content before the dot is set as __module__ in
the created exception class, and the content after it is set as
__name__.

This commit mirrors that behaviour, by introducing a `module` argument
to `PyContext.new_class`: if Some("module_name") is passed, it will be
set as `__module__`.  All exception-creating uses of `new_class` are
updated to pass in their module and class names separately.

[0] https://github.com/python/cpython/blob/main/Python/errors.c#L1082-L1087
2021-11-02 18:28:02 -04:00
David Carlier
f56514d61b netbsd build fix proposal 2021-10-31 08:41:14 +00:00
Noa
09e9ea91e7 TryFrom, TryInto, FromIterator are in prelude now 2021-10-21 17:04:19 -05:00
Jeong YunWon
617e524556 clean up windows socket attrs 2021-10-14 16:36:01 +09:00
Jeong YunWon
141ff2bb2f _socket uses #[pymodule] 2021-10-14 14:11:21 +09:00
varun-krishnan
f5c4c0b4c0 added gethostbyname_ex function 2021-10-13 05:56:54 +09:00
Jeong YunWon
05dca7a7c8 ctx.new_list returns PyLsitRef 2021-10-12 01:22:36 +09:00
Jeong YunWon
a42d547a3f new_{utf8_str, ascii_literal} -> new_str again 2021-10-11 21:28:14 +09:00
Jeong YunWon
379cf2db6f new_bytes return PyRef 2021-10-11 16:10:01 +09:00
Jeong YunWon
616dfc19e2 vm.new_tuple to convert rust tuple to python tuple 2021-10-11 01:06:07 +09:00
Jeong YunWon
741cfea565 vm.ctx.new_int returns PyInt 2021-10-11 01:05:38 +09:00
Jeong YunWon
92de3619fa move IntoPy{Object, Exception, Result} to vm::function
which are used to define function arguments - those functions are mostly placed in the crate
2021-10-06 19:10:16 +09:00
Jeong YunWon
fb25a15f2c split rustpython-stdlib crate 2021-10-01 01:54:04 +09:00