A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-November/029943.html below:

[Python-Dev] Metaclass insanity - another use case

[Python-Dev] Metaclass insanity - another use case [Python-Dev] Metaclass insanity - another use caseGuido van Rossum guido@python.org
Tue, 05 Nov 2002 21:32:27 -0500
> I've been wondering recently whether Python could benefit
> from having an "instance" statement which does for instances
> what the "class" statement does for classes.
> 
> The idea is you'd be able to say something like
> 
>    instance isSpecification(model.Field):
>       isRequired = 1
>       qualifiedName = 'Foundation.Core.ModelElement.isSpecification'
> 
> and it would be equivalent to
> 
>    isSpecification = model.Field(isRequired = 1,
>       qualifiedName = 'Foundation.Core.ModelElement.isSpecification')
> 
> One of the use cases I have in mind is GUI programming, where
> you frequently need to build complicated nested structures with
> lots of keyword arguments to constructors. A construct like this
> might help you to lay out the code more neatly and readably.

-1.

TOOWTDI.

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4