added suggested changes

This commit is contained in:
mejrs 2021-05-03 00:58:00 +02:00
parent dc99707756
commit aa6a236362
1 changed files with 4 additions and 4 deletions

View File

@ -74,11 +74,11 @@ pub fn pyproto(_: TokenStream, input: TokenStream) -> TokenStream {
/// | Parameter | Description | /// | Parameter | Description |
/// | :- | :- | /// | :- | :- |
/// | `name = "python_name"` | Sets the name that Python sees this class as. Defaults to the name of the Rust struct. | /// | `name = "python_name"` | Sets the name that Python sees this class as. Defaults to the name of the Rust struct. |
/// | `freelist = N` | Implements a [free list][10] of size N. This can improve performance for types that are often created and deleted in a row. Profile your code to see whether `freelist` is right for you. | /// | `freelist = N` | Implements a [free list][10] of size N. This can improve performance for types that are often created and deleted in quick succession. Profile your code to see whether `freelist` is right for you. |
/// | `gc` | Participate in Python's [garbage collection][5]. Required if your type contains references to other Python objects. If you don't (or incorrectly) implement this, contained Python objects may be hidden from Python's garbage collector and you may leak memory. Note that leaking memory, while undesirable, [is safe behavior][7].| /// | `gc` | Participate in Python's [garbage collection][5]. Required if your type contains references to other Python objects. If you don't (or incorrectly) implement this, contained Python objects may be hidden from Python's garbage collector and you may leak memory. Note that leaking memory, while undesirable, [is safe behavior][7].|
/// | `weakref` | Allows this class to be [weakly referenceable][6]. | /// | `weakref` | Allows this class to be [weakly referenceable][6]. |
/// | `extends = BaseType` | Use a custom baseclass. Defaults to [`PyAny`][4] | /// | `extends = BaseType` | Use a custom baseclass. Defaults to [`PyAny`][4] |
/// | `subclass` | Allows Python classes to inherit from this class. | /// | `subclass` | Allows other Python classes and `#[pyclass]` to inherit from this class. |
/// | `unsendable`<!-- hack to stop the column from wrapping -->&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; | Required if your struct is not [`Send`][3]. Rather than using `unsendable`, consider implementing your struct in a threadsafe way by e.g. substituting [`Rc`][8] with [`Arc`][9]. By using `unsendable`, your class will panic when accessed by another thread.| /// | `unsendable`<!-- hack to stop the column from wrapping -->&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; | Required if your struct is not [`Send`][3]. Rather than using `unsendable`, consider implementing your struct in a threadsafe way by e.g. substituting [`Rc`][8] with [`Arc`][9]. By using `unsendable`, your class will panic when accessed by another thread.|
/// | `module = "module_name"` | Python code will see the class as being defined in this module. Defaults to `builtins`. | /// | `module = "module_name"` | Python code will see the class as being defined in this module. Defaults to `builtins`. |
/// ///
@ -107,11 +107,11 @@ pub fn pyclass(attr: TokenStream, input: TokenStream) -> TokenStream {
/// | Parameter | Description | /// | Parameter | Description |
/// | :- | :- | /// | :- | :- |
/// | `name = "python_name"` | Sets the name that Python sees this class as. Defaults to the name of the Rust struct. | /// | `name = "python_name"` | Sets the name that Python sees this class as. Defaults to the name of the Rust struct. |
/// | `freelist = N` | Implements a [free list][10] of size N. This can improve performance for types that are often created and deleted in a row. Profile your code to see whether `freelist` is right for you. | /// | `freelist = N` | Implements a [free list][10] of size N. This can improve performance for types that are often created and deleted in quick succession. Profile your code to see whether `freelist` is right for you. |
/// | `gc` | Participate in Python's [garbage collection][5]. Required if your type contains references to other Python objects. If you don't (or incorrectly) implement this, contained Python objects may be hidden from Python's garbage collector and you may leak memory. Note that leaking memory, while undesirable, [is safe behavior][7].| /// | `gc` | Participate in Python's [garbage collection][5]. Required if your type contains references to other Python objects. If you don't (or incorrectly) implement this, contained Python objects may be hidden from Python's garbage collector and you may leak memory. Note that leaking memory, while undesirable, [is safe behavior][7].|
/// | `weakref` | Allows this class to be [weakly referenceable][6]. | /// | `weakref` | Allows this class to be [weakly referenceable][6]. |
/// | `extends = BaseType` | Use a custom baseclass. Defaults to [`PyAny`][4] | /// | `extends = BaseType` | Use a custom baseclass. Defaults to [`PyAny`][4] |
/// | `subclass` | Allows Python classes to inherit from this class. | /// | `subclass` | Allows other Python classes and `#[pyclass]` to inherit from this class. |
/// | `unsendable`<!-- hack to stop the column from wrapping -->&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; | Required if your struct is not [`Send`][3]. Rather than using `unsendable`, consider implementing your struct in a threadsafe way by e.g. substituting [`Rc`][8] with [`Arc`][9]. By using `unsendable`, your class will panic when accessed by another thread.| /// | `unsendable`<!-- hack to stop the column from wrapping -->&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; | Required if your struct is not [`Send`][3]. Rather than using `unsendable`, consider implementing your struct in a threadsafe way by e.g. substituting [`Rc`][8] with [`Arc`][9]. By using `unsendable`, your class will panic when accessed by another thread.|
/// | `module = "module_name"` | Python code will see the class as being defined in this module. Defaults to `builtins`. | /// | `module = "module_name"` | Python code will see the class as being defined in this module. Defaults to `builtins`. |
/// ///