Automatic Generation of Python Class Files

Sunburned Surveyor sunburned.surveyor at gmail.com
Mon Oct 22 18:05:30 EDT 2007


On Oct 22, 11:44 am, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> > You wrote: " can't think of a single reason why you would ever want to
> > do this,
> > since your "list of method and property names" would be just as
> > verbose as just typing the actual python code."
>
> > I don't think I understand how this would be the same amount of
> > typing. Consider the following example that would generate a Monster
> > class file from an input text file (I only did one property and method
> > in generated class file.):
>
> > Contents of input text file:
>
> > [Name]
> > Fire Breathing Dragon
>
> > [Properties]
> > Strength
> > Scariness
> > Endurance
>
> > [Methods]
> > eatMaiden argMaiden
> > fightKnight argKnight
>
> Others have already given you reasons why that is a bad idea. Another
> one is this: how do you deal with changes to your generated classfile?
> It's complicated to ensure that you don't override modified code with
> generated.
>
> Diez- Hide quoted text -
>
> - Show quoted text -

Diez,

I didn't realize all of the shortcomings with my example until the
others responded. I was just trying to save myself some typing, but I
realize know the problem was my lack of understanding Python syntax.

I will consider myself schooled! :]

Scott Huey




More information about the Python-list mailing list