Back to index

python3.2  3.2.2
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Private Attributes
test.test_doctest2.C Class Reference
Inheritance diagram for test.test_doctest2.C:
Inheritance graph
[legend]
Collaboration diagram for test.test_doctest2.C:
Collaboration graph
[legend]

List of all members.

Classes

class  D

Public Member Functions

def __init__
def __str__
def getx
def setx
def clsm

Static Public Member Functions

def statm

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Properties

 x

Private Attributes

 _x

Detailed Description

Class C.

>>> print(C())  # 2
42


We include some (random) encoded (utf-8) text in the text surrounding
the example.  It should be ignored:

    ЉЊЈЁЂ

Definition at line 20 of file test_doctest2.py.


Constructor & Destructor Documentation

C.__init__.

>>> print(C()) # 3
42

Definition at line 34 of file test_doctest2.py.

00034 
00035     def __init__(self):
00036         """C.__init__.
00037 
00038         >>> print(C()) # 3
00039         42
00040         """

Here is the caller graph for this function:


Member Function Documentation

>>> print(C()) # 4
42

Definition at line 41 of file test_doctest2.py.

00041 
00042     def __str__(self):
00043         """
00044         >>> print(C()) # 4
00045         42
00046         """
00047         return "42"

def test.test_doctest2.C.clsm (   cls,
  val 
)
A class method.

>>> print(C.clsm(22))    # 18
22
>>> print(C().clsm(23))  # 19
23

Definition at line 99 of file test_doctest2.py.

00099 
00100     def clsm(cls, val):
00101         """
00102         A class method.
00103 
00104         >>> print(C.clsm(22))    # 18
00105         22
00106         >>> print(C().clsm(23))  # 19
00107         23
00108         """
00109         return val

def test.test_doctest2.C.getx (   self)
>>> c = C()    # 7
>>> c.x = 12   # 8
>>> print(c.x)  # 9
-12

Definition at line 61 of file test_doctest2.py.

00061 
00062     def getx(self):
00063         """
00064         >>> c = C()    # 7
00065         >>> c.x = 12   # 8
00066         >>> print(c.x)  # 9
00067         -12
00068         """
00069         return -self._x

def test.test_doctest2.C.setx (   self,
  value 
)
>>> c = C()     # 10
>>> c.x = 12    # 11
>>> print(c.x)   # 12
-12

Definition at line 70 of file test_doctest2.py.

00070 
00071     def setx(self, value):
00072         """
00073         >>> c = C()     # 10
00074         >>> c.x = 12    # 11
00075         >>> print(c.x)   # 12
00076         -12
00077         """
00078         self._x = value

def test.test_doctest2.C.statm ( ) [static]
A static method.

>>> print(C.statm())    # 16
666
>>> print(C().statm())  # 17
666

Definition at line 87 of file test_doctest2.py.

00087 
00088     def statm():
00089         """
00090         A static method.
00091 
00092         >>> print(C.statm())    # 16
00093         666
00094         >>> print(C().statm())  # 17
00095         666
00096         """
00097         return 666


Member Data Documentation

>>> c = C()     # 10
>>> c.x = 12    # 11
>>> print(c.x)   # 12
-12

Definition at line 77 of file test_doctest2.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


Property Documentation

Initial value:
property(getx, setx, doc="""\
    >>> c = C()    # 13    >>> c.x = 12   # 14    >>> print(c.x)  # 15    -12    """)

Definition at line 79 of file test_doctest2.py.


The documentation for this class was generated from the following file: