Home | Trees | Index | Help |
|
---|
Package harold :: Package prog :: Package namespace :: Module ambiguous_member :: Class AmbiguousMember |
|
object
--+
|
AmbiguousMember
An implementation artifact to manage ambiguous members.
Instances of this class are not supposed to be constructed directly, but rather by theambiguous
function.
Method Summary | |
---|---|
__init__(self,
name,
cls,
warn_only,
automate)
| |
__delete__(self,
obj)
| |
__get__(self,
obj,
typ)
| |
__set__(self,
obj,
value)
| |
__str__(self)
| |
A decorator for assigning a namespace to a function. | |
Assign a given namespace (i.e. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
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) <==> x.name = value |
Method Details |
---|
namespace_dec(self, namespace)A decorator for assigning a namespace to a function. Both following codes are equivalent:# version with decorator @ambiguous_member.namespace_dec (A_Class) def f(x,y,z): pass # equivalent version without the decorator def f(x,y,z): pass ambiguous_member.set_namespace (A_Class, f)
|
set_namespace(self, namespace, context=1)Assign a given namespace (i.e. class from which the ambiguous member should take its definition) for the given context. The context can be a callable, a property (in which case all methods of the property will taken into account), a class (in which case all members of the class will be taken into account), a module or an integer value. If an integer value n, the namespace is assigned to the n next lines of code. If not given, the context defaults to value 1 (i.e. the next line of code). IMPORTANT: the context must not be in the <stdin> file, because line number are nor reliable there. Any attempt to set a namespace to such a context will issue a warning and have no other effect.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Dec 18 15:25:58 2006 | http://epydoc.sf.net |