Commit Graph

77 Commits

Author SHA1 Message Date
Jeong YunWon
20b2f64cef Add float.__rmod__ 2019-04-28 22:46:21 +09:00
Jeong YunWon
304cea89b8 objint::get_float_value 2019-04-28 20:31:07 +09:00
Jeong YunWon
4810a55c82 Add float.__trunc__ 2019-04-28 12:44:25 +09:00
Jeong YunWon
9dda776e25 Add float.__int__ / float.__float__ 2019-04-28 12:41:59 +09:00
Jeong YunWon
7fb98c91d2 PyFloat uses #[pyclass] #[pyimpl] #[pymethod] 2019-04-28 05:47:29 +09:00
Adam
90ded15339 Merge pull request #799 from RustPython/joey/ref-receiver
Allow first argument to be a shared ref to a python value
2019-04-07 10:02:03 +01:00
Joey Hain
c2716040d2 float: take self by shared ref 2019-04-06 19:05:18 -07:00
Joey Hain
be55562457 Allow first argument to be a shared ref to a python value 2019-04-06 18:50:40 -07:00
Joey Hain
98889d5339 match_class! macro 2019-04-01 20:09:45 -07: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
ben
6fa059fd6c Make PyObject.typ a PyClassRef 2019-03-24 10:51:52 +13:00
Adam Kelly
9ebbde8126 Replace special cases in boolval with __bool__ method on types. 2019-03-23 09:31:42 +00: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
ben
5c7812734d Use more specific ref type than PyObjectRef in PyContext 2019-03-23 13:00:12 +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
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
e3a5ac1378 Make objint::get_value return a reference 2019-03-11 23:07:56 +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
Adrian Wielgosik
10531191bb Convert most tuple/list methods to new args style 2019-03-08 20:43:20 +01:00
Adrian Wielgosik
1601da0692 Migrate PyFloat to new method style 2019-03-07 19:47:16 +01:00
Windel Bouwman
d7f8961a12 Simplify some PyFuncArgs occurences. 2019-03-06 22:30:11 +01:00
Adrian Wielgosik
eed0b3ca45 Add float.as_integer_ratio() 2019-03-04 20:52:56 +01:00
Joey Hain
e7fb116210 Convert more objects to Any payload 2019-03-02 13:27:00 -08:00
Windel Bouwman
30ddb48037 Use PyResult at more places. 2019-03-02 14:10:46 +01:00
coolreader18
58e1533b12 Fix clippy lint for float_is_integer 2019-03-01 20:12:54 -06:00
Joey Hain
d3646925ea Fix float() 2019-02-25 21:57:37 -08:00
Joey Hain
f10fa6db44 Remove outer RefCell from PyObjectRef 2019-02-25 21:01:37 -08:00
Adam Gutglick
f4e6e5dec8 Addred real property and is_integer function to float. 2019-02-24 04:02:24 +02:00
Joey
df76ffe116 Replace most relative imports with 2018-style crate 2019-02-20 08:50:53 -08:00
Joey Hain
c6ac393f84 Add {int,float}.{__radd__,__rsub__,__rmul__,__rtruediv__} 2019-02-14 21:21:30 -08:00
Windel Bouwman
e5af4caecf Merge pull request #424 from janczer/add_object_lt_le_gt_ge
Add object.{__lt__, __le__, __gt__, __gt__}
2019-02-12 19:21:07 +01:00
janczer
9277e67b15 Add not_implemented to float.{__le__, __gt__, __ge__} 2019-02-12 18:32:26 +01:00
janczer
0887b55da8 Add object.{__lt__, __le__, __gt__, __gt__} 2019-02-12 15:32:07 +01:00
Joey Hain
38c0ea06e5 Support float(<str>) and float(<bytes>) 2019-02-11 19:40:55 -08:00
Joey Hain
dab4f7385f Use NotImplemented in binary operations 2019-02-10 09:19:06 -08:00
Windel Bouwman
05cd60bebc Merge pull request #415 from silmeth/fix-int-eq-float
fix int – float equality for big ints, inf and nan
2019-02-10 13:55:50 +01:00
janczer
454837f64b Fix fmt in objfloat 2019-02-09 19:16:04 +01:00
janczer
8d1d6ce1ee float.{__lt__, __le__, __ge__, __gt__} fix comparing with non float type 2019-02-09 17:05:32 +01:00
silmeth
6c56c22f0f fix floordiv and divmod by zero for ints and floats 2019-02-09 15:15:54 +01:00
silmeth
d960ca3d5b fix int – float equality for big ints, inf and nan 2019-02-09 14:02:43 +01:00
janczer
ba19732fbb Fix the fmt error 2019-02-08 22:09:42 +01:00
janczer
59706538f4 Fix typo and fix fmt errors 2019-02-08 21:56:07 +01:00
janczer
d4b82007df Add floats.{__truediv__, __mul__} 2019-02-08 20:34:33 +01:00