Joey Hain
aec33634ca
int: take self by ref
2019-04-07 10:07:31 -07:00
Joey
1c958c93b1
Merge pull request #774 from RustPython/joey/match-class
...
Add match_class! macro
2019-04-04 07:13:31 -07:00
Joey Hain
88bf2a32c4
address feedback
2019-04-03 17:30:04 -07:00
Joey Hain
8549ea22a3
Use match_class! in objint::to_int
2019-04-01 20:22:11 -07:00
coolreader18
4222d87e31
Merge branch 'master' into coolreader18/py_class-proc-macro
2019-03-29 13:55:08 -05:00
ben
ce9a909b9d
Change kind identifier to fully use python terminology
2019-03-29 19:03:13 +13:00
ben
b5dc5a28e7
Merge branch 'master' into int_new_args
...
# Conflicts:
# vm/src/function.rs
2019-03-29 18:51:19 +13:00
ben
657d025592
Change syntax of attributes in FromArgs proc macro
2019-03-28 21:34:11 +13:00
ben
3ca387b509
Enhance FromArgs derive proc macro to allow positional, and positional
...
or keyword arguments.
2019-03-28 05:55:15 +13:00
Joey Hain
8bdc766bed
Use name field directly
2019-03-25 19:32:58 -07:00
Joey Hain
6474a4a6ef
Remove objtype::get_type_name()
2019-03-25 19:18:07 -07:00
Joey Hain
cc4f3fdb40
Clean up TypeProtocol
2019-03-25 19:18:01 -07:00
Joey
f2d562a4cc
pyint: use as_bigint() everywhere
2019-03-24 10:05:25 -07:00
Joey
9a0113deed
range: represent w/ int refs
2019-03-24 09:59:06 -07:00
Joey
c2e1e9b0dc
Convert range to new args style
2019-03-24 09:59:06 -07:00
Joey
2aee2981e3
Remove FromPyObjectRef, replace with downcast
2019-03-23 09:38:03 -07:00
ben
c1d5ce715f
Change isinstance/issubclass to accept PyClassRef instead of PyCObject.
...
Also changed PyValue::class to return a PyClassRef.
2019-03-23 19:32:31 +13:00
Windel Bouwman
68ba050030
Use the extend class macro more.
2019-03-22 20:45:34 +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
Joey
fa9e48a5b3
Take &mut VirtualMachine insteadof &PyContext
2019-03-14 21:43:19 -07:00
Joey
737ec12fa5
Rename PyValue::{required_type => class}
2019-03-14 20:08:41 -07:00
Adrian Wielgosik
6b1598dbb4
Change some methods to return BigInt directly
2019-03-13 20:21:07 +01:00
Adrian Wielgosik
f647f346f2
Use Into<BigInt> instead of ToBigInt to avoid copies
2019-03-13 20:20:42 +01:00
Adrian Wielgosik
e3a5ac1378
Make objint::get_value return a reference
2019-03-11 23:07:56 +01:00
Adrian Wielgosik
4cbb1a38f1
Convert most objint functions to new args style
2019-03-11 19:20:22 +01:00
Joey Hain
053ceb1a30
Move payload boxing into PyObject::new
2019-03-10 20:19:28 -07:00
Joey Hain
5971fc3bd4
rename PyObjectPayload2 to PyValue
2019-03-10 13:48:51 -07:00
Joey Hain
e2e13af7ea
Remove PyObjectPayload
2019-03-10 13:45:38 -07:00
Joey Hain
45bc8c8f7a
Move PyRef to pyobject module
2019-03-10 13:01:46 -07:00
Joey
f9ab27296a
Add conversions for all primitive ints
2019-03-06 20:38:52 -08:00
Joey
ecc92ffe33
Convert int to Any payload
2019-03-06 19:25:54 -08:00
Joey Hain
4558dbf210
Fix build (rustfmt)
2019-03-02 13:25:42 -08:00
Windel Bouwman
b98926a0fb
Merge pull request #572 from RustPython/joey/fun-with-functions
...
Derive types, arity, conversions and more from rust fns
2019-03-02 20:56:52 +01:00
Windel Bouwman
30ddb48037
Use PyResult at more places.
2019-03-02 14:10:46 +01:00
Joey
990c29469a
Merge remote-tracking branch 'origin/master' into joey/fun-with-functions
...
Conflicts:
vm/src/pyobject.rs
2019-02-28 10:44:46 -08:00
Windel Bouwman
b0ee1947c7
Merge pull request #565 from alexpantyukhin/add_kwarg_handling_to_int
...
add kwarg handling for int
2019-02-28 07:36:08 +01:00
Joey Hain
7f75e3ee8a
Significant improvements to new function definition style
...
- PyRef<T> type for accepting references to payloads.
- Args<T> type for consuming remaining positional args
(mirrors python `*args`).
- KwArgs<T> type for consuming remaining keyword args
(mirrors python `*kwargs`).
- OptArg<T> type for consuming remaining keyword args
(no python code equivalent, only possible in native functions like in cpython).
- PyIterable<T> for accepting an iterator over a sequence of Ts.
- Arity checking (but TypeError messages need work)
2019-02-27 19:53:20 -08:00
apantykhin
7e2c702c5e
fix fmt
2019-02-27 21:22:24 +00:00
alexpantyukhin
d806a19c23
add kwarg handling for int
2019-02-27 19:58:32 +00:00
alexpantyukhin
70ad78eb21
fix error messages.
2019-02-27 13:22:27 +04:00
alexpantyukhin
15e6187583
add overflow errors for int shifts.
2019-02-27 11:11:38 +04:00
Joey Hain
f10fa6db44
Remove outer RefCell from PyObjectRef
2019-02-25 21:01:37 -08:00
Windel Bouwman
027a6847e5
Merge pull request #525 from RustPython/joey/extractor-pattern
...
Use "extractor" pattern for native functions
2019-02-25 07:22:00 +01:00
Joey Hain
2919d7f520
Initial arg type checking
2019-02-23 19:27:22 -08:00
Joey Hain
c14a8302e8
Initial prototype of "extractor pattern" for native funcs
2019-02-23 18:16:02 -08:00
Adam Kelly
2ab90b234a
Fix unused variable warning in objint.
2019-02-21 21:05:46 +00:00
Windel Bouwman
565023f55b
Merge pull request #518 from AdamGS/add_int_attributes
...
Added real/imag attributes to int type.
2019-02-21 20:52:06 +01:00
Adam Gutglick
0c1057f079
Added real/imag attributes to int type.
2019-02-21 13:46:18 -05:00
Joey
df76ffe116
Replace most relative imports with 2018-style crate
2019-02-20 08:50:53 -08:00