3 Suggestions to Make Python Easier For Children

Marko Rauhamaa marko at pacujo.net
Sat Aug 2 13:07:48 EDT 2014


Steven D'Aprano <steve+comp.lang.python at pearwood.info>:

> Marko Rauhamaa wrote:
>> __setattr__ could create __dict__ belatedly.
>
> Are we designing Son Of PHP, or a sensible language? *wink*
>
> If object.__setattr__ did this, then we're left with two equally
> horrible choices:

Not a huge issue. Only mildly annoying to have to create:

   class Object: pass

in every application.

And the newest Python releases let you replace that with:

   import types
   Object = types.SimpleNamespace


Marko



More information about the Python-list mailing list