aditya shukla wrote:
Hello folks , i am using the newick module
http://www.daimi.au.dk/~mailund/newick.html.I am just learning to use it
and i have a question about it.
from newick.tree import parse_tree
from newick.tree import add_parent_links
from newick.tree import add_distance_from_root
En Sat, 03 Mar 2007 17:04:33 -0300, Arnaud Delobelle
<[EMAIL PROTECTED]> escribió:
> On Mar 2, 11:01 pm, Nicholas Parsons <[EMAIL PROTECTED]>
> wrote:
>> That is the beauty of using Python. You have a choice of using
>> classes and traditional OOP techniques or sticking to top level
>> function
On Mar 2, 11:01 pm, Nicholas Parsons <[EMAIL PROTECTED]>
wrote:
> Hi Claire,
>
> That is the beauty of using Python. You have a choice of using
> classes and traditional OOP techniques or sticking to top level
> functions. For short, small scripts it would probably be overkill to
> use clas
Silver Rock wrote:
> Friends,
>
> I don´t see why using classes.. functions does everything already. I
> read the Rossum tutotial and two other already.
>
> Maybe this is because I am only writing small scripts, or some more
> serious misunderstandings of the language.
>
> Please give me a light
Den Fri, 02 Mar 2007 19:26:08 -0300 skrev Silver Rock:
> Friends,
>
> I don´t see why using classes.. functions does everything already. I
> read the Rossum tutotial and two other already.
>
> Maybe this is because I am only writing small scripts, or some more
> serious misunderstandings of the
Hi Claire,
That is the beauty of using Python. You have a choice of using
classes and traditional OOP techniques or sticking to top level
functions. For short, small scripts it would probably be overkill to
use classes. Yet the programmer still has classes in his tool chest
if he/she is
Silver Rock a écrit :
> Friends,
>
> I don´t see why using classes.. functions does everything already. I
> read the Rossum tutotial and two other already.
>
> Maybe this is because I am only writing small scripts, or some more
> serious misunderstandings of the language.
or both ?-)
If you onl
Setash enlightened us with:
>> class1.py:
>>
>> class Class1(object):
>> pass
>>
>> class2.py:
>> import class1
This line imports class1.py and places its contents under the name
"class1".
> classes.py:
>
> class Class1
> pass
>
> class Class2(Class1)
> pass
That's co
John Salerno wrote:
> Setash wrote:
>
>> And have class2 inherit class1 without any import statements, or need
>> it be imported first?
>> Or need class1 and class2 be both declared in the same .py file if
>> there is inheritance?
>
> If the classes are in the same module, you don't need to do an
Andreas, and everyone else - thank you! I do appreciate the information
and the quick responses, this single post with <10 replies has
significantly helped my understanding level.
Thanks again!
--
http://mail.python.org/mailman/listinfo/python-list
Setash schrieb:
> 2) Function overloading - is it possible?
>
> Can I have the following code, or something which acts the same in
> python?:
>
>
> def function(a, b)
>do things
>
> def function(a, b, c)
>do things only if I get a third argument
Several ways. The simplest and often mo
Setash wrote:
> Also, I have seen the following syntax used once before, and havent
> found any documentation on it, any comments as to use, where to find
> docs, etc?:
>
> from module import x as name
> name.function()
All that does is give you a method for renaming a particularly unrul
Setash a écrit :
> I've got a tiny bit of coding background, but its not the most
> extensive.
>
> That said, I'm trying to wrap my head around python and have a couple
> questions with classes and functions.
>
> Two notable questions:
>
> 1) Classes. How do you extend classes?
>
> I know its a
Setash wrote:
> And have class2 inherit class1 without any import statements, or need
> it be imported first?
> Or need class1 and class2 be both declared in the same .py file if
> there is inheritance?
If the classes are in the same module, you don't need to do any
importing or qualification. I
> >
> > And have class2 inherit class1 without any import statements, or need
> > it be imported first?
>
> It needs to be imported first:
>
> class1.py:
>
> class Class1(object):
> pass
>
> class2.py:
> import class1
>
> class Class2(class1.Class1):
> pass
>
In respo
Setash enlightened us with:
> 1) Classes. How do you extend classes?
>
> I know its as easy as:
>
> class classname(a)
>do stuff
>
>
> But where does the parent class need to lie? In the same file? Can
> it lie in another .py file in the root directory?
It doesn't matter at all, as long as 'a'
16 matches
Mail list logo