Re: noob import question

2006-05-20 Thread Carl Banks
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

Re: noob import question

2006-05-19 Thread Ben Finney
[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

Re: noob import question

2006-05-19 Thread bruno at modulix
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

Re: [OT] noob import question

2006-05-19 Thread bruno at modulix
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

Re: noob import question

2006-05-19 Thread bruno at modulix
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

Re: noob import question

2006-05-19 Thread Fredrik Lundh
"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

Re: noob import question

2006-05-19 Thread PA
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

Re: noob import question

2006-05-19 Thread Diez B. Roggisch
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

Re: noob import question

2006-05-19 Thread Brian Blazer
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

Re: noob import question

2006-05-19 Thread Diez B. Roggisch
> 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.

Re: noob import question

2006-05-19 Thread Iain King
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

noob import question

2006-05-19 Thread Brian Blazer
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