[Python-Dev] Definining properties - a use case for class decorators?

Michele Simionato michele.simionato at gmail.com
Mon Oct 24 13:41:18 CEST 2005


On 10/24/05, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
> I'd say using a class statement to define a property is metaclass
> abuse, as would
> anything that wouldn't define something class-like. The same is true
> for other
> constructs, using an decorator to define something that is not a
> callable would IMHO
> also be abuse.

+1

> That said, I really have an opinion on the 'create' statement
> proposal yet. It
> does seem to have a very limited field of use.

This is definitely non-true. The 'create' statement would have lots of
applications. On top of my mind I can think of 'create' applied to:

- bunches;
- modules;
- interfaces;
- properties;
- usage in framewors, for instance providing sugar for
Object-Relational mappers,
  for making templates (i.e. a create HTMLPage);
- building custom minilanguages;
- ...

This is way I see a 'create' statement is frightening powerful addition to the
language.

     Michele Simionato


More information about the Python-Dev mailing list