[Tutor] Shell Output Format - [was: Is there Python code for accessing an object's reference count?]

2006-10-08 Thread Ilias Lazaridis
Kent Johnson wrote: ... > In [2]: sys.getrefcount(100) > Out[2]: 43 > > In [3]: def foo(): > ...: return 100 > ...: > > In [4]: sys.getrefcount(100) > Out[4]: 44 off-topic: how to you get this output format of the shell? In [2]: Out[2]: I've tried to alter IDLE: IDLE - Customizin

Re: [Tutor] Looking for Constructs to Remove Redundant Code

2006-03-31 Thread Ilias Lazaridis
Kent Johnson wrote: ... Thank you for your comments. I realize that my request was not very clear. I make a 2nd attemp, more simplified: I have this python code: class Car(BaseClass) : manufacturer = stringFactory() model = stringFactory() modelYear = integerFactory() d

[Tutor] Looking for Constructs to Remove Redundant Code

2006-03-31 Thread Ilias Lazaridis
I have this python code class Car: """Type of car.""" manufacturer = f.string() model = f.string() modelYear = f.integer() _key(manufacturer, model, modelYear) def __str__(self): return '%s %s %s' % (self.modelYear, self.manufacturer, self.model) - and w