PA wrote:
> On May 19, 2006, at 15:33, Diez B. Roggisch wrote:
>
> > And it seems as if you have some JAVA-background, putting one class in
> > one
> > file called the same as the class. Don't do that, it's a stupid
> > restriction
> > in JAVA and should be avoided in PYTHON.
>
> Restrictive or not
[Please don't top-post. Please don't indiscriminately quote the entire
message you respond to.
http://en.wikipedia.org/wiki/Top_posting>]
Brian Blazer <[EMAIL PROTECTED]> writes:
> Thank you for your responses. I had a feeling is had something to
> do with a namespace issue but I wasn't sure.
A
PA wrote:
>
> On May 19, 2006, at 15:33, Diez B. Roggisch wrote:
>
>> And it seems as if you have some JAVA-background, putting one class in
>> one
>> file called the same as the class. Don't do that, it's a stupid
>> restriction
>> in JAVA and should be avoided in PYTHON.
>
> Restrictive or no
Brian Blazer wrote:
please, dont top-post, and edit out irrelevant material
> You are right, I do come from a Java background.
Then you may want to read this:
http://dirtsimple.org/2004/12/python-is-not-java.html
HTH
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w
Brian Blazer wrote:
> OK, I have a very simple class here:
>
> class Student:
class Student(object):
> """Defines the student class"""
>
> def __init__(self, lName, fName, mi):
> self.lName = lName
> self.fName = fName
> self.mi = mi
Do yourself a favour: use me
"PA" <[EMAIL PROTECTED]> wrote:
> Restrictive or not, what's so fundamentally devious in putting a class
> declaration in a separate file whose name is that of the declared class
> (class Queue -> Queue.py)?
nothing.
> Sounds like a handy way of organizing your code, no?
sure, if you prefer to
On May 19, 2006, at 15:33, Diez B. Roggisch wrote:
> And it seems as if you have some JAVA-background, putting one class in
> one
> file called the same as the class. Don't do that, it's a stupid
> restriction
> in JAVA and should be avoided in PYTHON.
Restrictive or not, what's so fundamental
Brian Blazer wrote:
> Thank you for your responses. I had a feeling is had something to do
> with a namespace issue but I wasn't sure.
>
> You are right, I do come from a Java background. If it is poor form
> to name your class file the same as your class, can I ask what the
> standard is?
Con
Thank you for your responses. I had a feeling is had something to do
with a namespace issue but I wasn't sure.
You are right, I do come from a Java background. If it is poor form
to name your class file the same as your class, can I ask what the
standard is?
Thanks again,
Brian
On May 19
> I have tried to look up what is going on, but I have not found
> anything. Would it be possible for someone to take a minute and give
> an explanation?
The
from import <*|nameslist>
syntax imports some or all names found in into the current modules
namespace. Thus you can access your class.
Brian Blazer wrote:
> OK, I have a very simple class here:
>
> class Student:
> """Defines the student class"""
>
> def __init__(self, lName, fName, mi):
> self.lName = lName
> self.fName = fName
> self.mi = mi
>
> Then I have a small script that I am using as
OK, I have a very simple class here:
class Student:
"""Defines the student class"""
def __init__(self, lName, fName, mi):
self.lName = lName
self.fName = fName
self.mi = mi
Then I have a small script that I am using as a test:
from Student import *
s1 = Stu
12 matches
Mail list logo