Property with Arguments

Fredrik Lundh fredrik at pythonware.com
Fri Jan 11 06:20:50 EST 2008


Lie wrote:

> Is there a way to create a property with arguments?

That's called method in Python, and has it's own syntax.  You cannot 
assign to methods.

 > Or an index value like a list?

Make the property that returns a list-like object (hooking __getitem__, 
__setitem__, etc).

</F>




More information about the Python-list mailing list