473,438 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,438 software developers and data experts.

predefined empty base class ??

iwl
Hi,

is there an predefined empty base class
which I can instanziate to have an
container i can copy attributes in?

Jan 17 '07 #1
5 7205
is there an predefined empty base class
which I can instanziate to have an
container i can copy attributes in?
No, but you can always do

class Foo(object):
pass

foo = Foo()

foo.attribute = value

Diez
Jan 17 '07 #2
iwl wrote:
Hi,

is there an predefined empty base class
which I can instanziate to have an
container i can copy attributes in?
you are not the only one missing such class

http://groups.google.com/group/comp....f946e7da13dba9

RFE SF #1637926
Robert
Jan 17 '07 #3
robert wrote:
iwl wrote:
>Hi,

is there an predefined empty base class
which I can instanziate to have an container i can copy attributes in?

you are not the only one missing such class

http://groups.google.com/group/comp....f946e7da13dba9

RFE SF #1637926

( and x=Exception();x.a=1 will do it preliminary )
Robert
Jan 17 '07 #4
At Wednesday 17/1/2007 15:34, Dennis Lee Bieber wrote:
is there an predefined empty base class
which I can instanziate to have an
container i can copy attributes in?

I think that's a two-liner...
>class EmptyBase(object):
... pass
Do you want a one liner?

class EmptyBase(object): pass

:)
--
Gabriel Genellina
Softlab SRL


__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas

Jan 17 '07 #5
Gabriel Genellina wrote:
At Wednesday 17/1/2007 15:34, Dennis Lee Bieber wrote:
is there an predefined empty base class
which I can instanziate to have an
container i can copy attributes in?

I think that's a two-liner...
>>class EmptyBase(object):
... pass

Do you want a one liner?

class EmptyBase(object): pass

:)
Isn't "predefined" a zero liner :-;
Jan 18 '07 #6

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

Similar topics

3
by: Emmanuel Thomé | last post by:
This is a comment aside the empty class behavior FAQ. I understand there are a fair number of reasons which make empty classes have non-zero size (except as base classes). If ``class foo'' were...
3
by: Markus Dehmann | last post by:
I have a two different value types with which I want to do similar things: store them in the same vector, stack, etc. Also, I want an << operator for each of them. class Value{}; // this would...
3
by: Mark Turney | last post by:
Problem: I have a vector full of two different derived class objects (class B and class C) that are derived from the same base class A. I want to loop through vector and invoke a member function...
3
by: lovecreatesbeauty | last post by:
Predefined class member functions and inheritance How many member functions on earth can be provided (predefined) by standard-compliant compilers? Scott Meyers says that there are 6:...
4
by: lovecreatesbeauty | last post by:
How many member functions will be predefined (provided by compilers implicitly) and called by standard-compliant compilers for a class? Does such a list be given in iso/iec 14882? Which member...
6
by: free2cric | last post by:
Hi, What will the syntax sound like for checking size of an empty class? what will be the size. Thanks, Cric
4
by: avranju | last post by:
Hi, We have a few exception marker classes in a project that are used only to throw exceptions. I mean stuff like this (this may not be such a hot idea for doing exception handling - a simple...
4
by: Coder | last post by:
Hi, Running into an issue. I am creating a base class. This base class has a "State" property of type "States" which is a locally defined enum type. The issue is this...the derived class...
5
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.