mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
...
This commit is contained in:
parent
cfe1f56489
commit
fbd62c7b50
@ -10,6 +10,7 @@ Setup pocketpy
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include "pocketpy.h"
|
#include "pocketpy.h"
|
||||||
|
using namespace pkpy;
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a python virtual machine
|
Create a python virtual machine
|
||||||
|
@ -29,3 +29,63 @@ The features marked with `YES` are supported, and the features marked with `NO`
|
|||||||
| Type Annotation | `def f(a:int, b:float=1)` | YES |
|
| Type Annotation | `def f(a:int, b:float=1)` | YES |
|
||||||
| Generator | `yield i` | YES |
|
| Generator | `yield i` | YES |
|
||||||
| Decorator | `@cache` | YES |
|
| Decorator | `@cache` | YES |
|
||||||
|
|
||||||
|
## Supported magic methods
|
||||||
|
|
||||||
|
#### Unary operators
|
||||||
|
|
||||||
|
+ `__repr__`
|
||||||
|
+ `__str__`
|
||||||
|
+ `__hash__`
|
||||||
|
+ `__len__`
|
||||||
|
+ `__iter__`
|
||||||
|
+ `__next__`
|
||||||
|
+ `__json__`
|
||||||
|
+ `__neg__`
|
||||||
|
+ `__bool__` (unused)
|
||||||
|
|
||||||
|
#### Logical operators
|
||||||
|
|
||||||
|
+ `__eq__`
|
||||||
|
+ `__lt__`
|
||||||
|
+ `__le__`
|
||||||
|
+ `__gt__`
|
||||||
|
+ `__ge__`
|
||||||
|
+ `__contains__`
|
||||||
|
|
||||||
|
#### Binary operators
|
||||||
|
|
||||||
|
+ `__add__`
|
||||||
|
+ `__radd__`
|
||||||
|
+ `__sub__`
|
||||||
|
+ `__rsub__`
|
||||||
|
+ `__mul__`
|
||||||
|
+ `__rmul__`
|
||||||
|
+ `__truediv__`
|
||||||
|
+ `__floordiv__`
|
||||||
|
+ `__mod__`
|
||||||
|
+ `__pow__`
|
||||||
|
+ `__matmul__`
|
||||||
|
+ `__lshift__`
|
||||||
|
+ `__rshift__`
|
||||||
|
+ `__and__`
|
||||||
|
+ `__or__`
|
||||||
|
+ `__xor__`
|
||||||
|
+ `__invert__`
|
||||||
|
|
||||||
|
#### Indexer
|
||||||
|
|
||||||
|
+ `__getitem__`
|
||||||
|
+ `__setitem__`
|
||||||
|
+ `__delitem__`
|
||||||
|
|
||||||
|
#### Specials
|
||||||
|
|
||||||
|
+ `__new__`
|
||||||
|
+ `__init__`
|
||||||
|
+ `__call__`
|
||||||
|
+ `__divmod__`
|
||||||
|
+ `__enter__`
|
||||||
|
+ `__exit__`
|
||||||
|
+ `__name__`
|
||||||
|
+ `__all__`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user