Why no number methods?

Magnus Lie Hetland mlh at idi.ntnu.no
Tue May 15 12:17:26 EDT 2001


"Michael Hudson" <mwh at python.net> wrote in message
news:m3pudbnnq4.fsf at atrus.jesus.cam.ac.uk...
>
> Ah, right.  Yes Py3K probably is a long way off - but some of the
> things that you might expect to be in Py3K might be in 2.2.  Or not.

Right. He said (in the text) that Py3K might well end up being 2.8 or
something... I'm sure a lot of cool stuff will appear in 2.2 as well :)

> But if all objects behave like instances, somewhere there is a class
> "class" (probably written in C) that looks a bit like this:
>
> class class:
>     ...
>     def __repr__(self):
>         return "<class %s.%s at %d>"%(self.__module__,
>                                       self.__class__,
>                                       id(self))
>     ...
>
> So C.__repr__ might be expected to return a bound version of *this*
> method (and in some situations will have to, as otherwise
>
> print C
>
> would blow up with an exception).

Ah! Now I see my error. I read your statement as "C().__repr__", not
"C.__repr__". Right...

>
> Cheers,
> M.

--

  Magnus Lie Hetland         http://www.hetland.org

 "Reality is that which, when you stop believing in
  it, doesn't go away."           -- Philip K. Dick






More information about the Python-list mailing list