[Dev] a poll: slightly different python syntax
John Anderson
john at osafoundation.org
Thu Aug 11 16:29:53 PDT 2005
I mildly prefer the class.classMethod syntax. In some cases I could
imagine more than one classMethod to create an Item.
In your example below, it's unclear which parenthesis matches the one
just before ".install(...
John
Alec Flett wrote:
>
> So pje and I are working on a more compact python syntax for defining
> lots of items (like the 100+ it takes to make chandler's menus) Don't
> worry, we're not getting rid of update(), just providing a more
> compact syntax that does things like automatic itsName, parent/child
> relationships, and so forth.
>
> we're looking at something like:
>
> Menu.template('FileMenu', _('File'),...
> childrenBlocks=[
> MenuItem.template('NewNote', _('New Note..'),...),
> MenuItem.template(...
> ]).install(parcel)
>
> One of the big bonuses being that you just do a single
> .install(parcel) at the bottom of the template definition, and provide
> your own specialized syntax for specific classes (for instance, Blocks
> would always just take the first parameter as the blockName)
>
> Now the trick here is that we have a few options for 'wrapping'
> classnames.
> For instance above you see '<blockname>.template(...)'. Other options
> include:
>
> * '<blockname>.make(...)' (the word 'make' being shorter than
> 'template' and clear that you're 'making' a block)
> * t.<blockname>(...) where you'd be able to prefix <blockname>
> with any old string, such as 't'
>
> Votes?
>
> Alec
>
>------------------------------------------------------------------------
>
>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
>Open Source Applications Foundation "Dev" mailing list
>http://lists.osafoundation.org/mailman/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/dev/attachments/20050811/8ecc9d5f/attachment.htm
More information about the Dev
mailing list