473,471 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

class problem

when i declare a class, is there difference between the below:
class myClass():
class myClass(threading.Thread)

Aug 28 '06 #1
8 1359
fegge wrote:
when i declare a class, is there difference between the below:
class myClass():
class myClass(threading.Thread)
Yes, the first one is a syntax error because you aren't allowed empty
parentheses in a class statement but the second one is a syntax error
because you don't have a colon.
Aug 28 '06 #2
sorry ,look at this :
class myClass:
class myClass(threading.Thread):

Aug 28 '06 #3
fegge wrote:
when i declare a class, is there difference between the below:
class myClass():
class myClass(threading.Thread)
the former is a base class, the latter inherits behaviour from the
threading.Thread class.

*please* read the tutorial before proceeding.

</F>

Aug 28 '06 #4
Duncan Booth wrote:
Yes, the first one is a syntax error because you aren't allowed empty
parentheses in a class statement
however,

$ python
Python 2.5c1 /.../
>>class foo():
.... pass
....
>>foo
<class __main__.foo at 0x00A3D840>
>>>
</F>

Aug 28 '06 #5
fegge a écrit :
when i declare a class, is there difference between the below:
class myClass():
class myClass(threading.Thread)
If you don't know the answer to this, then it's time to read the fine
manual. Please come back when done.
Aug 28 '06 #6
On 8/28/06, Fredrik Lundh <fr*****@pythonware.comwrote:
Duncan Booth wrote:
Yes, the first one is a syntax error because you aren't allowed empty
parentheses in a class statement

however,

$ python
Python 2.5c1 /.../
>>class foo():
... pass
...
>>foo
<class __main__.foo at 0x00A3D840>
>>>

</F>

--
http://mail.python.org/mailman/listinfo/python-list
D:\python>python
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>class foo():
File "<stdin>", line 1
class foo():
^
SyntaxError: invalid syntax

seems like a feature/bug of 2.5, why your learning a language with a
beta version?
Aug 28 '06 #7
Jorge Vargas wrote:
seems like a feature/bug of 2.5, why your learning a language with a
beta version?
learning?

(btw, the "c" in 2.5c1 means *release candidate*, not "beta").

</F>

Aug 28 '06 #8
On 8/28/06, Fredrik Lundh <fr*****@pythonware.comwrote:
Jorge Vargas wrote:
seems like a feature/bug of 2.5, why your learning a language with a
beta version?

learning?
I'm sorry I though you where the original poster.
>
(btw, the "c" in 2.5c1 means *release candidate*, not "beta").
I was referring to "beta" as oposite to stable/released
>
</F>

--
http://mail.python.org/mailman/listinfo/python-list
Aug 28 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve | last post by:
Hello, I'm encountering an unexpected behavior when using the "new" modifier in a derived class to hide an inherited base class property. I use "new" intentionally so I can change the Type of...
9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class...
21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
21
by: Mark Broadbent | last post by:
Consider the following statements //------- Item i = Basket.Items; //indexer is used to return instance of class Item Basket.Items.Remove(); //method on class item is fired item i = new...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
8
by: tshad | last post by:
I cannot seem to get the asp:textbox to use classes. Style works fine. I am trying to set the textbox to act like a label in some instance so it doesn't have a border, readonly and the background...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
3
by: TamusJRoyce | last post by:
Hello. This is my first thread here. My problem has probably been came across by a lot of people, but tutorials and things I've seen don't address it (usually too basic). My problem is that I...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.