Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83282 > unrolled thread

Re: Comparisons and sorting of a numeric class....

Started byDave Angel <davea@davea.name>
First post2015-01-07 02:16 -0500
Last post2015-01-07 02:16 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Comparisons and sorting of a numeric class.... Dave Angel <davea@davea.name> - 2015-01-07 02:16 -0500

#83282 — Re: Comparisons and sorting of a numeric class....

FromDave Angel <davea@davea.name>
Date2015-01-07 02:16 -0500
SubjectRe: Comparisons and sorting of a numeric class....
Message-ID<mailman.17433.1420615002.18130.python-list@python.org>
On 01/06/2015 10:37 PM, Andrew Robinson wrote:
>
> On 01/06/2015 06:31 PM, Chris Angelico wrote:
>>
>
> I already KNOW that 'C++' does have a workaround mechanism, as I've
> mentioned in a different e-mail, so that there's no reason to
> instantiate an instance of the subclass of a singleton if you don't want
> to.  That objection is really spurrious... so I really don't understand
> why Rossum cut off subclassability itself ... wasn't there any other way
> he could have prevented instantiation of subclasses without preventing
> the definition of a subclass itself?
>
> I mean, even in python I can execute some methods of a class without
> actually INSTANTIATING that class.
> eg:
>
> import decimal
> decimal.getcontext()

Interesting that you pick as your example an ordinary function, not in a 
class at all.  In this example, decimal is a module;  you're calling a 
module level function.  Perfectly normal.

But you're right, you can call staticmethods of a class without 
instantiating it, and you can also call classmethods.  But in both 
cases, the caller knows exactly what class he's referring to.  Doesn't 
help your argument any.

If you're not going to instantiate the class, then the fact that such a 
class is, or is not, a subclass of another is invisible, in any context 
I can think of (other than debuggers and such that do inspection by 
reflection).

-- 
DaveA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web