[Tutor] Dynamically naming functions

Kent Johnson kent37 at tds.net
Mon Mar 13 13:52:48 CET 2006


Kent Johnson wrote:
> Why not just use nested dicts?
> 
> MyProject = dict(
>    start = "2006-03-06",
>    resource = Me,
>    Task1 = dict(start = "2006-03-13"),
>    Task2 = dict(effort = "1w"),
> )

or nest class instances directly:

MyProject = Project(
    start = "2006-03-06",
    resource = Me,
    Task1 = Task(start = "2006-03-13"),
    Task2 = Task(effort = "1w"),
)

That seems pretty clear to me, it would be a snap to create dynamically 
and the implementation is simple.

Kent



More information about the Tutor mailing list