module examples.custom_container_python
¶
Short summary¶
module cpyquickhelper.examples.custom_container_python
Implements a custom container which may contain everything.
Classes¶
class |
truncated documentation |
---|---|
Type enumeration, similar to dtype. Members: VOID : untyped pointer BYTE : byte pointer FLOAT : float pointer … |
|
Custom container, may contain almost everything. |
Properties¶
property |
truncated documentation |
---|---|
Returns the type of every elements of the container. |
|
name(self: handle) -> str |
|
Returns the size in bytes of the container. |
|
|
Documentation¶
Implements a custom container which may contain everything.
- class cpyquickhelper.examples.custom_container_python.ContainerType(self: cpyquickhelper.examples.custom_container_python.ContainerType, value: int)¶
Bases:
pybind11_object
Type enumeration, similar to dtype.
Members:
VOID : untyped pointer
BYTE : byte pointer
FLOAT : float pointer
DOUBLE : double pointer
INT64 : int64 pointer
- __index__(self: cpyquickhelper.examples.custom_container_python.ContainerType) int ¶
- __init__(self: cpyquickhelper.examples.custom_container_python.ContainerType, value: int) None ¶
- __int__(self: cpyquickhelper.examples.custom_container_python.ContainerType) int ¶
- __members__ = {'BYTE': <ContainerType.BYTE: 1>, 'DOUBLE': <ContainerType.DOUBLE: 3>, 'FLOAT': <ContainerType.FLOAT: 2>, 'INT64': <ContainerType.INT64: 4>, 'VOID': <ContainerType.VOID: 0>}¶
- __setstate__(self: cpyquickhelper.examples.custom_container_python.ContainerType, state: int) None ¶
- __str__()¶
name(self: handle) -> str
- property name¶
- class cpyquickhelper.examples.custom_container_python.PyCContainer(*args, **kwargs)¶
Bases:
pybind11_object
Custom container, may contain almost everything.
- Parameters:
value – value to copy or to hold or pointer onto
copy – if True, the constructor copies the data, if False, the pointer is just borrowed.
Warning
If copy is False, the developer must know what it is doing as this pointer may be deleted if the object is not used by python anymore.
Overloaded function.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: str, copy: bool = True) -> None
Copies the bytes into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: numpy.ndarray[numpy.int64], copy: bool = True) -> None
Copies the integer into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: numpy.ndarray[numpy.float64], copy: bool = True) -> None
Copies the doubles into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: numpy.ndarray[numpy.float32], copy: bool = True) -> None
Copies the floats into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: cpyquickhelper.examples.custom_container_python.PyCContainer, copy: bool = True) -> None
Copies or borrow the container into another one.
- __getitem__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, arg0: int) int ¶
Returns the ith bytes of the container.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: str, copy: bool = True) -> None
Copies the bytes into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: numpy.ndarray[numpy.int64], copy: bool = True) -> None
Copies the integer into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: numpy.ndarray[numpy.float64], copy: bool = True) -> None
Copies the doubles into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: numpy.ndarray[numpy.float32], copy: bool = True) -> None
Copies the floats into the container.
__init__(self: cpyquickhelper.examples.custom_container_python.PyCContainer, value: cpyquickhelper.examples.custom_container_python.PyCContainer, copy: bool = True) -> None
Copies or borrow the container into another one.
- property dtype¶
Returns the type of every elements of the container.
- property size¶
Returns the size in bytes of the container.