Commit Graph

25 Commits

Author SHA1 Message Date
Aviv Palivoda
7d2c4b6b6e memoryview support __getitem__ 2019-06-28 10:19:44 +03:00
Michel Heily
b2cdeab0c6 Fix memoryview.obj misimplementation.
The memoryview skeleton did not correctly assign the "obj" attribute;
The "obj" attribute was assigned to the memoryview class and not the memryview object,
leading to a funny bug that can be reproduced as follows:

```python

m1 = memoryview(b'1234')
m2 = memoryview(b'abcd')

print(m1.obj)
```

the result would be the value inside `m2` instead that of `m1`
2019-06-05 02:36:45 +03:00
Jimmy Girardet
14658b6236 move is_byte to try_as_byte
move trait IsByte to ByteOr
refactor center
refactor count
fix center with negative value
add test for count(integer)
2019-04-18 14:15:13 +02:00
jgirardet
c550360be5 add is_bytes_like add bytes.count wthout slice 2019-04-18 14:15:13 +02:00
Adam Kelly
c8eda3733d Eliminate ctx.set_attr. 2019-04-05 09:50:31 +01:00
ben
6fa059fd6c Make PyObject.typ a PyClassRef 2019-03-24 10:51:52 +13:00
Adam
26a238085f Merge pull request #724 from RustPython/cleaning-tweaks
Increase usage of extend_class macro.
2019-03-23 09:14:50 +00:00
Windel Bouwman
b93f96d491 Increase usage of extend_class macro. 2019-03-23 09:16:32 +01: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
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
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
776dd80591 memoryview 2019-03-09 14:58:33 -08:00
Joey
eec76ef8e8 Don't require objtype import to use arg_check! macro 2019-02-21 08:38:02 -08:00
Joey
df76ffe116 Replace most relative imports with 2018-style crate 2019-02-20 08:50:53 -08:00
Adrian Wielgosik
21299ecf3d Refactor arg_check macro 2019-02-13 21:05:23 +01:00
ZapAnton
0d3b218237 Fixed the 'toplevel_ref_arg' clippy warning
This replaces all the occurrences of the
'let ref var = another_var' with the
'let var = &another_var'

Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg
2019-02-05 21:45:56 +03:00
Windel Bouwman
892493e464 Rename PyObjectKind into PyObjectPayload 2019-01-30 18:06:27 +01:00
rmliddle
9a86bbd718 ByteArray Usage 2019-01-28 18:30:19 +11:00
rmliddle
08a9fd9819 memoryview object, FileIO Methods 2019-01-01 23:39:21 +11:00