forked from NCAS-CMS/cf-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontainer.py
More file actions
56 lines (35 loc) · 1.36 KB
/
container.py
File metadata and controls
56 lines (35 loc) · 1.36 KB
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
"""This class is not in the cf.mixin package because it needs to be
imported by cf.Data, and some of the other mixin classes in cf.mixin
themselves import cf.Data, which would lead to a circular import
situation.
"""
from ..docstring import _docstring_substitution_definitions
class Container:
"""Mixin class for storing components.
.. versionadded:: 3.7.0
"""
def __repr__(self):
"""Called by the `repr` built-in function.
x.__repr__() <==> repr(x)
.. versionadded:: 3.16.0
"""
return super().__repr__().replace("<", "<CF ", 1)
def __docstring_substitutions__(self):
"""Define docstring substitutions that apply to this class and
all of its subclasses.
These are in addtion to, and take precendence over, docstring
substitutions defined by the base classes of this class.
See `_docstring_substitutions` for details.
.. versionadded:: 3.7.0
.. seealso:: `_docstring_substitutions`
:Returns:
`dict`
The docstring substitutions that have been applied.
"""
return _docstring_substitution_definitions
def __docstring_package_depth__(self):
"""Return the package depth for {{package}} docstring
substitutions.
See `_docstring_package_depth` for details.
"""
return 0