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


Groups > comp.lang.python > #83282

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

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'argument': 0.05; 'class,': 0.07; 'context': 0.07; 'referring': 0.07; 'caller': 0.09; 'function,': 0.09; 'rossum': 0.09; 'python': 0.11; '(other': 0.16; 'any.': 0.16; 'invisible,': 0.16; 'mean,': 0.16; 'objection': 0.16; 'singleton': 0.16; 'subclass': 0.16; 'subclasses': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'not,': 0.20; 'example': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; "i've": 0.25; 'class.': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'andrew': 0.30; 'decimal': 0.31; 'ordinary': 0.31; 'workaround': 0.31; 'class': 0.32; 'another': 0.32; 'skip:d 20': 0.34; 'could': 0.34; 'knows': 0.35; 'definition': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; "he's": 0.36; 'example,': 0.37; 'level': 0.37; 'to:addr:python- list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'does': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'mentioned': 0.61; "you're": 0.61; 'such': 0.63; 'pick': 0.64; 'different': 0.65; 'normal.': 0.68; 'received:74.208': 0.68; 'e-mail,': 0.69; 'cut': 0.74; 'itself?': 0.84; 'preventing': 0.84; 'received:74.208.4.194': 0.84
Date Wed, 07 Jan 2015 02:16:24 -0500
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Comparisons and sorting of a numeric class....
References <54ABB88A.7070504@r3dsolutions.com> <54ABC52A.1050507@davea.name> <54ABE383.3020801@r3dsolutions.com> <CAPTjJmpktyHfghEr+cjPrhso7JgB4VfS4=5Gdi95gT0aFbSYGA@mail.gmail.com> <54AC97D9.4010504@r3dsolutions.com> <CAPTjJmooTK_+HVoeyeSrqBHN1=YjRYQ2kfDyQtL9JoA9SbTqsQ@mail.gmail.com> <54ACAA04.60801@r3dsolutions.com>
In-Reply-To <54ACAA04.60801@r3dsolutions.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:CYpmOo5w1bsIsish50mWmDdhu0EXXOXQoU6h7N4B9oL om2nzkcLuSIIvzCtqI3zp1AcywZ/QdhAwTBPbxDZu9W1J6kIIv kBGCQb3xEgi2jjNZD6O3+DCLTm2f1MyfLZ1vdrHoUKn47crKNB 0EIsfVRlS5kY237sy2x9Km4BhSk2FgsJ4G0aLgAF3vqK7Scd9T 67di07Ms4faGLY3hc2FmxvwrRtKO7kRWUx+XVSL0Yzkt7vtf6X ghdXAeabVmVfhLonkcqfYzc6JHvKLjYUm35Gx/OrFA0sVk4eow RxICA1j5xlUj2CjeGr8IRfekklgneH7uSZiBSZGyUzbfIOLDgG diqJMtfCsLQywD/ZqJe4=
X-UI-Out-Filterresults notjunk:1;
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17433.1420615002.18130.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1420615002 news.xs4all.nl 2923 [2001:888:2000:d::a6]:37147
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83282

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web