[Python-ideas] Simple class initialization
Nick Coghlan
ncoghlan at gmail.com
Sun Apr 17 15:13:58 CEST 2011
On Sun, Apr 17, 2011 at 10:46 AM, Bruce Leban <bruce at leapyear.org> wrote:
> Note that I wrote fd:[auto_init.private] instead of auto_init.private. One
> of the strange aspects (to me) of parameter annotations is that they have no
> semantics which opens them up to multiple conflicting uses. If we
> standardize on a convention that the annotation is a list (or tuple)
> of annotations, then this leads us to usage like
>
> foo:[auto_init.name('bar'),constraint.non_negative,etc].
The idea is for annotations to be paired with decorators that define
the semantics.
Yes, that does mean that they aren't composable - decorators need to
provide an alternate initialisation mechanism for cases where the
annotations are already being used for something else.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list