Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
doctest._TestClass Class Reference

List of all members.

Public Member Functions

def __init__
def square
def get

Public Attributes

 val

Detailed Description

  1. Example Usage
    A pointless class, for sanity-checking of docstring testing.
    
    Methods:
        square()
        get()
    
    >>> _TestClass(13).get() + _TestClass(-12).get()
    1
    >>> hex(_TestClass(13).square().get())
    '0xa9'
    

Definition at line 2547 of file doctest.py.


Constructor & Destructor Documentation

def doctest._TestClass.__init__ (   self,
  val 
)
val -> _TestClass object with associated value val.

>>> t = _TestClass(123)
>>> print(t.get())
123

Definition at line 2561 of file doctest.py.

02561 
02562     def __init__(self, val):
02563         """val -> _TestClass object with associated value val.
02564 
02565         >>> t = _TestClass(123)
02566         >>> print(t.get())
02567         123
02568         """
02569 
02570         self.val = val

Here is the caller graph for this function:


Member Function Documentation

def doctest._TestClass.get (   self)
get() -> return TestClass's associated value.

>>> x = _TestClass(-42)
>>> print(x.get())
-42

Definition at line 2581 of file doctest.py.

02581 
02582     def get(self):
02583         """get() -> return TestClass's associated value.
02584 
02585         >>> x = _TestClass(-42)
02586         >>> print(x.get())
02587         -42
02588         """
02589 
02590         return self.val

Here is the caller graph for this function:

def doctest._TestClass.square (   self)
square() -> square TestClass's associated value

>>> _TestClass(13).square().get()
169

Definition at line 2571 of file doctest.py.

02571 
02572     def square(self):
02573         """square() -> square TestClass's associated value
02574 
02575         >>> _TestClass(13).square().get()
02576         169
02577         """
02578 
02579         self.val = self.val ** 2
02580         return self


Member Data Documentation

Definition at line 2569 of file doctest.py.


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