Re: [Tutor] Class learning

2015-01-23 Thread Alan Gauld
On 23/01/15 01:44, jarod...@libero.it wrote: How can gave the attributes __name__ to a function? You don't Python does it for you. class Foo(object): def __init__(self): steps = {} tmp = open("rnaseq.base.ini","rb") config.readfp(tmp) readsets = pa

Re: [Tutor] Class learning

2015-01-23 Thread Danny Yoo
You are trying to use advanced features of Python, and they are not the right tool for what you're trying to do. Specifically, you're trying two things at the same time: 1. Properties, which allows method calls to look like simple variable access. 2. The __name__ special attribute on methods (

Re: [Tutor] Class learning

2015-01-23 Thread Danny Yoo
On Fri, Jan 23, 2015 at 12:37 AM, jarod...@libero.it wrote: > Thanks for the help and patience! > It is a function on the class so I suppose for read that function list I > need self.steps Where I'm wrong? > @property > def steps(self): > return [ > >

Re: [Tutor] Class learning

2015-01-23 Thread Danny Yoo
> #@property > def show(self): > ftp="\n".join([str(idx + 1) + "- " + step.__name__ for idx, step in enumerate(self.steps)]) > Questions you should be asking yourself: What is self.steps? What type is it? In the case where this breaks with an error, what is self.steps t

[Tutor] Class learning

2015-01-22 Thread jarod...@libero.it
Dear All How can gave the attributes __name__ to a function? class Foo(object): def __init__(self): steps = {} tmp = open("rnaseq.base.ini","rb") config.readfp(tmp) readsets = parse_illumina_readset_file("/home/mauro/Desktop/readset.csv") @prop