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


Groups > comp.lang.python > #111072

Re: Namespaces are one honking great idea

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.unit0.net!fu-berlin.de!uni-berlin.de!not-for-mail
From jmp <jeanmichel@sequans.com>
Newsgroups comp.lang.python
Subject Re: Namespaces are one honking great idea
Date Mon, 04 Jul 2016 17:58:30 +0200
Lines 43
Message-ID <mailman.71.1467647921.2295.python-list@python.org> (permalink)
References <57767a97$0$1606$c3e8da3$5496439d@news.astraweb.com> <nldgv7$2e0$1@ger.gmane.org> <CAPTjJmp_ydenpqRrw5iS=TmP7dywxO6FJmKkGyJ5Do__Dnktiw@mail.gmail.com> <nle136$6ij$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de mZmfiUelCynS/yJfyYxDpgl/0y10oJzXBwrHRxUFuG6g==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'attributes': 0.07; 'instantiated': 0.09; 'namespace': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stating': 0.09; 'python': 0.10; 'missed': 0.15; 'packages.': 0.15; '2016': 0.16; 'argument.': 0.16; 'entities.': 0.16; 'ho,': 0.16; 'jmp': 0.16; 'namespace.': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:Namespaces': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; '>>>': 0.20; 'explicit': 0.22; 'names.': 0.22; 'header:In-Reply- To:1': 0.24; 'mon,': 0.24; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.26; 'chris': 0.26; 'helpful': 0.27; 'used,': 0.27; 'behaviour': 0.29; 'grouping': 0.29; 'classes': 0.30; 'probably': 0.31; "can't": 0.32; 'related': 0.32; 'class': 0.33; 'usually': 0.33; "d'aprano": 0.33; 'instances': 0.33; 'requirement.': 0.33; 'steven': 0.33; 'but': 0.36; 'should': 0.36; '(and': 0.36; 'modules': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'received:org': 0.37; 'missing': 0.37; 'seem': 0.37; 'stuff': 0.38; 'why': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'provide': 0.61; 'received:194': 0.61; 'charset:windows-1252': 0.62; 'more': 0.63; 'different': 0.63; 'qualified': 0.63; 'within': 0.64; 'stated': 0.70; 'jul': 0.72; 'chrisa': 0.84; 'construct': 0.84; 'others:': 0.84; 'using.': 0.84
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host paris.sequans.com
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
In-Reply-To <CAPTjJmp_ydenpqRrw5iS=TmP7dywxO6FJmKkGyJ5Do__Dnktiw@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <nle136$6ij$1@ger.gmane.org>
X-Mailman-Original-References <57767a97$0$1606$c3e8da3$5496439d@news.astraweb.com> <nldgv7$2e0$1@ger.gmane.org> <CAPTjJmp_ydenpqRrw5iS=TmP7dywxO6FJmKkGyJ5Do__Dnktiw@mail.gmail.com>
Xref csiph.com comp.lang.python:111072

Show key headers only | View raw


On 07/04/2016 01:37 PM, Chris Angelico wrote:
> On Mon, Jul 4, 2016 at 9:23 PM, jmp <jeanmichel@sequans.com> wrote:
>> On 07/01/2016 04:13 PM, Steven D'Aprano wrote:
>>>
>>> But classes are not like the others: they must be instantiated before they
>>> can be used, and they are more than just a mere namespace grouping related
>>> entities. Classes support inheritance. Classes should be used for "is-a"
>>> relationships, not "has-a" relationships. Although classes (and instances)
>>> are namespaces, they provide fundamentally different kind of behaviour
>>> than
>>> modules and packages.
>>
>>
>> A namespace would not hurt but I really don't get why you don't consider
>> classes a valid and rather helpful namespace.
>>
>> 1/ classes do not have to be instantiated.
>> 2/ the fact that classes are more than a namespace is not an argument.
>> Almost any object in python is able to do more than what you are actually
>> using.
>> 3/ Classes are used as much as 'is-a' than 'has-a', class instances *have* a
>> state usually described by attributes
>> 4/ "Although classes (and instances) are namespaces, ". You seem to
>> contradict yourself. It was probably a rhetorical construct but it's rather
>> confusing.
>
> Functions within the namespace can't call other functions within the
> same namespace using unqualified names. This was a stated requirement.
>
> ChrisA
>

Ho, I missed that one.

But if it's the only missing requirement, wouldn't be like stating that 
python instances are not instances because methods cannot call other 
methods without "self."ed qualified name ? We like explicit qualified 
stuff in python right ? ("explicit is better than implicit")

jm


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


Thread

Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-02 00:13 +1000
  Re: Namespaces are one honking great idea Random832 <random832@fastmail.com> - 2016-07-01 10:40 -0400
  Re: Namespaces are one honking great idea BartC <bc@freeuk.com> - 2016-07-01 15:49 +0100
    Re: Namespaces are one honking great idea Chris Angelico <rosuav@gmail.com> - 2016-07-02 03:13 +1000
    Re: Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-02 03:46 +1000
    Re: Namespaces are one honking great idea Rustom Mody <rustompmody@gmail.com> - 2016-07-01 19:26 -0700
  Re: Namespaces are one honking great idea Ethan Furman <ethan@stoneleaf.us> - 2016-07-01 09:00 -0700
    Re: Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-02 03:10 +1000
      Re: Namespaces are one honking great idea Ethan Furman <ethan@stoneleaf.us> - 2016-07-01 12:29 -0700
        Re: Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-02 11:07 +1000
          Re: Namespaces are one honking great idea Kevin Conway <kevinjacobconway@gmail.com> - 2016-07-02 01:50 +0000
            Re: Namespaces are one honking great idea Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-01 19:55 -0700
            Re: Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-03 13:22 +1000
          Re: Namespaces are one honking great idea Random832 <random832@fastmail.com> - 2016-07-02 00:59 -0400
          Re: Namespaces are one honking great idea Kevin Conway <kevinjacobconway@gmail.com> - 2016-07-02 15:34 +0000
            Re: Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-03 13:44 +1000
              Re: Namespaces are one honking great idea Ethan Furman <ethan@stoneleaf.us> - 2016-07-02 22:14 -0700
              Re: Namespaces are one honking great idea Kevin Conway <kevinjacobconway@gmail.com> - 2016-07-03 22:02 +0000
                Re: Namespaces are one honking great idea Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-03 16:21 -0700
                Re: Namespaces are one honking great idea BartC <bc@freeuk.com> - 2016-07-04 01:19 +0100
              Re: Namespaces are one honking great idea Ethan Furman <ethan@stoneleaf.us> - 2016-07-03 21:01 -0700
          Re: Namespaces are one honking great idea Ethan Furman <ethan@stoneleaf.us> - 2016-07-02 16:28 -0700
  Re: Namespaces are one honking great idea Chris Angelico <rosuav@gmail.com> - 2016-07-04 21:37 +1000
    Re: Namespaces are one honking great idea Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-04 15:09 -0700
      Re: Namespaces are one honking great idea Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-04 15:11 -0700
  Re: Namespaces are one honking great idea jmp <jeanmichel@sequans.com> - 2016-07-04 17:58 +0200
  Re: Namespaces are one honking great idea Chris Angelico <rosuav@gmail.com> - 2016-07-05 12:58 +1000
    Re: Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-05 13:35 +1000
      Re: Namespaces are one honking great idea Chris Angelico <rosuav@gmail.com> - 2016-07-05 13:47 +1000
        Re: Namespaces are one honking great idea Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-07-05 16:09 +1000
          A nestedmodule decorator (Re: Namespaces are one honking great idea) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-07-05 21:10 +1200
            Improved nestedmodule decorator implementation Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-07-05 21:31 +1200
              Re: Improved nestedmodule decorator implementation Steven D'Aprano <steve@pearwood.info> - 2016-07-05 20:54 +1000
  Re: Namespaces are one honking great idea Steven D'Aprano <steve@pearwood.info> - 2016-07-05 12:34 +1000
  Re: Namespaces are one honking great idea jmp <jeanmichel@sequans.com> - 2016-07-04 13:23 +0200
  Re: Namespaces are one honking great idea carlosjosepita@gmail.com - 2016-07-09 07:05 -0700

csiph-web