Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > What is object()

Reply
Thread Tools

What is object()

 
 
Hameed Khan
Guest
Posts: n/a
 
      01-22-2004
hi,
i was reading library refrence manual. there i found
object() function. they says in library refrence that
"Return a new featureless object. object() is
a base for all new style classes. It has the methods
that are common to all instances of new style
classes."

My questions are whats the use of this function and
the object returned by it? and what are new style
classes?.

Thanks,
Hameed Khan

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

 
Reply With Quote
 
 
 
 
Aahz
Guest
Posts: n/a
 
      01-22-2004
In article <mailman.655.1074790103.12720.python->,
Hameed Khan <> wrote:
>
> i was reading library refrence manual. there i found
>object() function. they says in library refrence that
> "Return a new featureless object. object() is
>a base for all new style classes. It has the methods
>that are common to all instances of new style
>classes."


There's not much use for an instance of object. Don't worry about it.

>My questions are whats the use of this function and
>the object returned by it? and what are new style
>classes?.


http://www.python.org/2.2.3/descrintro.html
--
Aahz () <*> http://www.pythoncraft.com/

A: No.
Q: Is top-posting okay?
 
Reply With Quote
 
 
 
 
John Roth
Guest
Posts: n/a
 
      01-22-2004
"Aahz" <> wrote in message
news:bup01m$hjm$...
> In article <mailman.655.1074790103.12720.python->,
> Hameed Khan <> wrote:
> >
> > i was reading library refrence manual. there i found
> >object() function. they says in library refrence that
> > "Return a new featureless object. object() is
> >a base for all new style classes. It has the methods
> >that are common to all instances of new style
> >classes."

>
> There's not much use for an instance of object. Don't worry about it.


Unless, of course, you're using the __new__() method.

John Roth

> --
> Aahz () <*>

http://www.pythoncraft.com/


 
Reply With Quote
 
David Eppstein
Guest
Posts: n/a
 
      01-22-2004
In article <bup01m$hjm$>, (Aahz)
wrote:

> > i was reading library refrence manual. there i found
> >object() function. they says in library refrence that
> > "Return a new featureless object. object() is
> >a base for all new style classes. It has the methods
> >that are common to all instances of new style
> >classes."

>
> There's not much use for an instance of object. Don't worry about it.


It can be useful when you want something that is guaranteed to be
different from all other objects and has no other purpose than existing
and being different.

Beyond that somewhat specialized use, object exists to be subclassed,
not instantiated directly.

--
David Eppstein http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science
 
Reply With Quote
 
Aahz
Guest
Posts: n/a
 
      01-22-2004
In article <>,
John Roth <> wrote:
>"Aahz" <> wrote in message
>news:bup01m$hjm$...
>> In article <mailman.655.1074790103.12720.python->,
>> Hameed Khan <> wrote:
>>>
>>> i was reading library refrence manual. there i found
>>>object() function. they says in library refrence that
>>> "Return a new featureless object. object() is
>>>a base for all new style classes. It has the methods
>>>that are common to all instances of new style
>>>classes."

>>
>> There's not much use for an instance of object. Don't worry about it.

>
>Unless, of course, you're using the __new__() method.


"Not much" != "none"
--
Aahz () <*> http://www.pythoncraft.com/

A: No.
Q: Is top-posting okay?
 
Reply With Quote
 
Gerrit Holl
Guest
Posts: n/a
 
      01-23-2004
Aahz wrote:
> >Unless, of course, you're using the __new__() method.

>
> "Not much" != "none"


"Not much" >= "none"
Because none is not much

yours,
Gerrit.

--
211. If a woman of the free class lose her child by a blow, he shall
pay five shekels in money.
-- 1780 BC, Hammurabi, Code of Law
--
PrePEP: Builtin path type
http://people.nl.linux.org/~gerrit/c.../pep-xxxx.html
Asperger's Syndrome - a personal approach:
http://people.nl.linux.org/~gerrit/english/

 
Reply With Quote
 
Dan Bishop
Guest
Posts: n/a
 
      01-23-2004
Gerrit Holl <> wrote in message news:<mailman.685.1074860576.12720.python->...
> Aahz wrote:
> > >Unless, of course, you're using the __new__() method.

> >
> > "Not much" != "none"

>
> "Not much" >= "none"
> Because none is not much


No, "Not much" < "none", because the comparison is case-sensitive.
However, it is True that "not much" >= "none" and "Not much" >= None

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57