File: bases.rst

package info (click to toggle)
domdf-python-tools 3.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,784 kB
  • sloc: python: 10,838; makefile: 7
file content (99 lines) | stat: -rw-r--r-- 1,962 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
==================================
:mod:`~domdf_python_tools.bases`
==================================

.. autosummary-widths:: 5/16

.. automodule:: domdf_python_tools.bases
	:autosummary-members:
	:no-members:

Type Variables
------------------

.. autotypevar:: domdf_python_tools.bases._F
.. autotypevar:: domdf_python_tools.bases._LU
.. autotypevar:: domdf_python_tools.bases._S

.. raw:: latex

	\begin{multicols}{2}

.. autotypevar:: domdf_python_tools.bases._T
.. autotypevar:: domdf_python_tools.bases._V

.. raw:: latex

	\end{multicols}


Dictable
---------

.. autoclass:: domdf_python_tools.bases.Dictable
	:inherited-members:
	:special-members:


UserList
---------

.. autoclass:: domdf_python_tools.bases.UserList
	:inherited-members:
	:special-members:


NamedList
----------

Both :class:`~.NamedList` and :func:`~.namedlist` can be used to create a named list.

:func:`~.namedlist` can be used as follows:

.. code-block:: python

	>>> ShoppingList = namedlist("ShoppingList")
	>>> shopping_list = ShoppingList(["egg and bacon", "egg sausage and bacon", "egg and spam", "egg bacon and spam"])
	>>>

If you wish to create a subclass with additional features it is recommended to subclass
from :class:`NamedList` rather than from :func:`~.namedlist`. For example, do this:


.. code-block:: python

	>>> class ShoppingList(NamedList):
	...     pass
	>>>

and not this:

.. code-block:: python

	>>> class ShoppingList(namedlist())
	...     pass
	>>>

This avoids any potential issues with :github:repo:`mypy <python/mypy>`.

.. autoclass:: domdf_python_tools.bases.NamedList
	:no-autosummary:
	:exclude-members: __repr__,__str__

.. autofunction:: domdf_python_tools.bases.namedlist


UserFloat
------------

.. autoclass:: domdf_python_tools.bases.UserFloat
	:inherited-members:
	:special-members:
	:exclude-members: __ceil__,__floor__,conjugate,imag,real

.. latex:clearpage::

Lineup
---------

.. autoclass:: domdf_python_tools.bases.Lineup