Python dynamic attribute creation

Andre Alexander Bell post at andre-bell.de
Wed Jun 30 05:01:54 EDT 2010


On 06/29/2010 06:46 PM, WANG Cong wrote:
> On 06/29/10 17:48, Andre Alexander Bell <post at andre-bell.de> wrote:
>>>>> var a
>>>>> a
>> -> should raise an variable 'unset' exception
>>
>> Keep in mind that the module you are writing in is just an object as is
>> any function or method. So using local variables therein you are doing
>> exactly what you want to abandon from the OOP part.
>>
> 
> Hmm, this looks really appealing.

I actually very much prefer Python's implementation with direct
assignment, just because it's short and comprehensible.

Regards


Andre




More information about the Python-list mailing list