Sorry I didn't get back earlier. But in short: Thank you! Kind Regards, Bjorn
On 3 May 2012 00:01, Alan Gauld <alan.ga...@btinternet.com> wrote: > Does anyone know if it is possible during run-time to: >>> a) add attributes to classes, which will unknown at program start, but >>> "emerge" later whilst the program is running? >>> >> > Yes, but its not very useful since the rest of your code won't know how to > access those attributes. There are ways around that (getattr() etc) > but in general it's a bad design pattern that should be avoided. > > But Python is an interpreted language so anything you can do in a script > file can also be done at runtime. > > > b) add subclasses to class (also during runtime) >>> >> > I'm not sure what you mean, but I'm guessing you are asking if you can > subclass an existing class. That is create a new class, and again the > answer is yes. > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > > ______________________________**_________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/**mailman/listinfo/tutor<http://mail.python.org/mailman/listinfo/tutor> > -- Bjorn Madsen *Researcher Complex Systems Research* Ph.: (+44) 0 7792 030 720 Ph.2: (+44) 0 1767 220 828 bjorn.mad...@operationsresearchgroup.com
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor