On Sun, 15 Nov 2009 16:26:59 -0800, Pyrot wrote:
> On 11월15일, 오후9시52분, "Diez B. Roggisch" wrote:
>> Pyrot schrieb:
>>
>> > class rawDNA:
>> > import string
[...]
> (Tthe core reason that I'm bothering with this at all is because I heard
> imports are costly(in time, space, processing power). I
On Nov 15, 6:26 pm, Pyrot wrote:
> what happens when I use the import statement within a class/function
> declaration?
> I'm thinking either
> 1) It imports during the class/function declaration
> 2) It imports the first time a class/function call(x = rawDNA() )
> occurs
>
> But if it's 2) then i
On 11월15일, 오후9시52분, "Diez B. Roggisch" wrote:
> Pyrot schrieb:
>
> > class rawDNA:
> > import string
>
> Importing here is unusual. Unless you have good reasons to do so, I
> suggest you put the imports on top of the file.
>
> > trans = string.maketrans("GATC","CTAG")
>
> > def __init__(s
On 11월15일, 오후10시15분, Tim Chase wrote:
> Pyrot wrote:
> > class rawDNA:
> >import string
> >trans = string.maketrans("GATC","CTAG")
>
> >def __init__(self, template = "GATTACA"):
> >self.template = template //shouldn't this make "template"
> > accessible within the scope of
Diez B. Roggisch schrieb:
Pyrot schrieb:
class rawDNA:
import string
Importing here is unusual. Unless you have good reasons to do so, I
suggest you put the imports on top of the file.
trans = string.maketrans("GATC","CTAG")
def __init__(self, template = "GATTACA"):
s
Pyrot wrote:
class rawDNA:
import string
trans = string.maketrans("GATC","CTAG")
def __init__(self, template = "GATTACA"):
self.template = template //shouldn't this make "template"
accessible within the scope of "rawDNA"??
No. Python's scope resolutio
Pyrot schrieb:
class rawDNA:
import string
Importing here is unusual. Unless you have good reasons to do so, I
suggest you put the imports on top of the file.
trans = string.maketrans("GATC","CTAG")
def __init__(self, template = "GATTACA"):
self.tem
class rawDNA:
import string
trans = string.maketrans("GATC","CTAG")
def __init__(self, template = "GATTACA"):
self.template = template //shouldn't this make "template"
accessible within the scope of "rawDNA"??
def noncoding(self):