blueloveTH 1 an în urmă
părinte
comite
84c4bf590c
3 a modificat fișierele cu 1 adăugiri și 21 ștergeri
  1. 1 18
      docs/bindings.md
  2. 0 1
      docs/cheatsheet.md
  3. 0 2
      include/pocketpy/cffi.h

+ 1 - 18
docs/bindings.md

@@ -112,26 +112,13 @@ struct Point{
 }
 ```
 
-You can write a wrapper class `wrapped__Point`. Add `PY_CLASS` macro into your wrapper class and implement a static function `_register`.
-
+You can write a wrapper class `wrapped__Point`. Add implement a static function `_register`.
 Inside the `_register` function, do bind methods and properties.
 
-```cpp
-PY_CLASS(T, mod, name)
-
-// T is the struct type in cpp
-// mod is the module name in python
-// name is the class name in python
-```
-
 ### Example
 
 ```cpp
 struct wrapped__Point{
-    // special macro for wrapper class
-    PY_CLASS(wrapped__Point, builtins, Point)
-    //       ^T              ^module   ^name
-
     // wrapped value
     Point value;
 
@@ -187,8 +174,6 @@ If your custom type stores `PyObject*` in its fields, you need to handle gc for
 
 ```cpp
 struct Container{
-    PY_CLASS(Container, builtins, Container)
-
     PyObject* a;
     std::vector<PyObject*> b;
     // ...
@@ -199,8 +184,6 @@ Add a magic method `_gc_mark() const` to your custom type.
 
 ```cpp
 struct Container{
-    PY_CLASS(Container, builtins, Container)
-
     PyObject* a;
     std::vector<PyObject*> b;
     // ...

+ 0 - 1
docs/cheatsheet.md

@@ -140,7 +140,6 @@ PyObject* list_t = vm->_t(vm->tp_list);
 Access extended python types
 
 ```cpp
-// VoidP was defined by `PY_CLASS` macro
 Type voidp_t = vm->_tp_user<VoidP>();
 ```
 

+ 0 - 2
include/pocketpy/cffi.h

@@ -63,8 +63,6 @@ POINTER_VAR(const bool*, "bool_p")
 
 
 struct C99Struct{
-    PY_CLASS(C99Struct, c, struct)
-
     static constexpr int INLINE_SIZE = 24;
 
     char _inlined[INLINE_SIZE];