Module vopu :: Class InitAttributes
[show private | hide private]
[frames | no frames]

Type InitAttributes

object --+

Base class for objects whose constructor initializes all attributes.

>>> obj = InitAttributes(myattr=u"value1", self=10)
>>> obj.myattr
>>> obj.self

Method Summary
  __init__(*args, **kwargs)
Create a new InitAttributes object.
    Inherited from object
x.__delattr__('name') <==> del
x.__getattribute__('name') <==>
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
helper for pickle
helper for pickle
x.__repr__() <==> repr(x)
x.__setattr__('name', value) <==> = value
x.__str__() <==> str(x)

Method Details

__init__(*args, **kwargs)

Create a new InitAttributes object.

All keyword arguments are converted into attributes. No positional arguments are allowed:

>>> obj = InitAttributes(100, myattr=u"value1")
Traceback (most recent call last):
TypeError: this constructor takes only keyword arguments

For security reasons, all keywords must start with an alphabetic character:

>>> obj = InitAttributes(_myattr=2)
Traceback (most recent call last):
NameError: invalid attribute name: '_myattr'

Generated by Epydoc 2.1 on Sun Aug 31 15:41:30 2008