By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,097 Members | 1,580 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,097 IT Pros & Developers. It's quick & easy.

why and when we should do it?

P: n/a
hi,everybody,Sorry to bother you.
i hvae seen some code like this before:

class BusinessBO :
dev __init__(slef):
#write you own code here
dev businessMethod :
#write you own code here
pass

why and when we should add the keyword "pass" ?

and some time i have seen

class SomeObject(Object) :
#some code

why and when we should inherit Object?

thanks in advanced.
--
Ȼ*£
ϡ˸
ŷ֣
*ҵļ
Ҹ˲䡣

һƮת۽ɰͷ̡
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Su Wei <po**********@gmail.com> writes:
hi,everybody,Sorry to bother you.
i hvae seen some code like this before:

class BusinessBO :
dev __init__(slef):
#write you own code here
dev businessMethod :
#write you own code here
pass

why and when we should add the keyword "pass" ?

and some time i have seen

class SomeObject(Object) :
#some code

why and when we should inherit Object?

thanks in advanced.


There are enough typos in your example that I'm guessing you actually saw:

class BusinessBO :
def __init__(self):
#write you own code here
pass
def businessMethod(self):
#write you own code here
pass
"pass" is the Python way to say "Yes, I know there should be code
here, but I don't want any." It is required in this context because a
"def" cannot be totally empty.

--
ha************@boeing.com
6-6M21 BCA CompArch Design Engineering
Phone: (425) 294-4718
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.