On 25 September 2014 12:33, Tennessee Leeuwenburg firstname.lastname@example.org wrote:
Thanks to everyone for the replies! I read them all with interest.
The fundamental issue for me is that you shouldn't just co-opt functionality. The semantics of a class is clearly intended to be a class of objects -- and instantiatable thing which is a core part of OO design. Re-using it for named blocks really just seems like it would be massively confusing, particularly if one were to interleave the two.
The metaclass system already allows for fairly significant variations in "class" semantics. In this case, a metaclass that disallowed instantiation and bypassed the normal class lookup machinery seems entirely feasible.
That doesn't seem any more fundamentally confusing than using the same syntax for normal classes, metaclasses, ABCs, enumerations, database ORM models, web framework form and view definitions, etc.