Re: [Tutor] Simulating case statement

2005-09-27 Thread Jan Eden
Kent Johnson wrote on 27.09.2005: >Jan Eden wrote: >>The problem is that the __init__ methods of the respective classes >>take a different number of parameters - this is why I pass the >>whole safe_parameters dictionary. > >I think if you pass the dictionary as keyword arguments rather than >as a

Re: [Tutor] Simulating case statement

2005-09-27 Thread Kent Johnson
Jan Eden wrote: > Hi, > > I used to use an extended if...elif sequence to instantiate an object and > call this object's display method afterwards: > > if safe['type'] == pages: > page = Show.Page(id=safe['id'], start=safe['start'] ...), > elif safe['type'] == pages: > author = Show.

[Tutor] Simulating case statement

2005-09-27 Thread Jan Eden
Hi, I used to use an extended if...elif sequence to instantiate an object and call this object's display method afterwards: if safe['type'] == pages: page = Show.Page(id=safe['id'], start=safe['start'] ...), elif safe['type'] == pages: author = Show.Author(id=safe['id']...) ... pag