Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #110910
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Namespaces are one honking great idea |
| Date | Sat, 2 Jul 2016 03:13:21 +1000 |
| Lines | 29 |
| Message-ID | <mailman.3.1467393204.2295.python-list@python.org> (permalink) |
| References | <57767a97$0$1606$c3e8da3$5496439d@news.astraweb.com> <nl5vtk$9nf$1@dont-email.me> <CAPTjJmok5gPp_5YpfNn=UFEtxz9PNAAPmX8Fj0z8O_1_ghJv2w@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| X-Trace | news.uni-berlin.de 8PBTsY2XjMn6UA2VQsWwvAju/ZGr+pq2mpcAc3F/y1Yg== |
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.007 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'python3': 0.05; 'cc:addr :python-list': 0.09; 'namespace': 0.09; 'python': 0.10; 'def': 0.13; '2016': 0.16; 'c():': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Namespaces': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'sat,': 0.23; 'tried': 0.24; 'header:In-Reply-To:1': 0.24; 'linux': 0.26; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; 'skip:( 20': 0.28; 'print': 0.30; 'extend': 0.31; "can't": 0.32; 'knows': 0.32; 'class': 0.33; 'received:google.com': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'thought': 0.37; 'why': 0.39; 'more': 0.63; 'capabilities': 0.72; 'jul': 0.72; '5.3.1': 0.84; 'chrisa': 0.84; 'to:none': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=uIpCmbDT/3yNu1/bia1QCRCE1AgZM8Lnx7aclRB/0Kc=; b=EeRnZa3wGHBC7F9SX3LQN/dbkENMp2PUmK94hmlz9/LxyRB+jpX2IHXtruGOg3IIVZ oEaH8qbBMM612fQRJUw4ET6qx3LK7CkFVoj1LqbyHabUX7YQuGF0R86wfbVpqYh4csCx 0wwSetXliMJqWtQC9jKTEsE7PVflP/MEYuGwkYuOn4RYRP/8PvrusOG83YSe5xFeEg/A pEDf4JALHC5KspCGBYUZ25/MK+fVZq2qUeVMi11ZNis7phFedDnLa37Hs41po7Yx958B txKrKdikAHBSMUww0+yFrB1pEtl8Aj6OpQQhlHeGomSraOQpCyOFdCG4G1m2jw5TwUsr F4gA== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=uIpCmbDT/3yNu1/bia1QCRCE1AgZM8Lnx7aclRB/0Kc=; b=K2BATaNcB3fIdfnifog1LWAAmp8Yvpu5IfGLLLEQsPUtLEWErn8GhdFZsaCvXblw0V BLoylhrGtorHbz73phCTn2aQ0f5D8IdsUmTQtOwSbSgQKGSY/SbGYo+g3en5bFhZ3M9e 4YXa86j+PX0GEf8u35vsl2oD4JMyD63muV2MsyzLYKRgQaLTchgXUzq/q7j7+nrCKcUV shRlBClUWcmTKanMijJCWIAGWn/dXGI726SsvAPmifTOuaUsx5xY6qpuSp8R8xoy0IEy BVbl5YEvzwk4pGgfBDHiyolb2eOZS9TapgUdH7ZZmpKjO2C6NhLUoh1kKWn3S+UbeZwZ +mkQ== |
| X-Gm-Message-State | ALyK8tK0h9owj6wWpHe01qJXFcrq2XD2TE/7HtBXG18RR0Z8Khn2OkY8Y97oGjBP1x2tEF2itlKRZSdZ9AcBSA== |
| X-Received | by 10.194.70.41 with SMTP id j9mr4634483wju.30.1467393202270; Fri, 01 Jul 2016 10:13:22 -0700 (PDT) |
| In-Reply-To | <nl5vtk$9nf$1@dont-email.me> |
| 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 | <CAPTjJmok5gPp_5YpfNn=UFEtxz9PNAAPmX8Fj0z8O_1_ghJv2w@mail.gmail.com> |
| X-Mailman-Original-References | <57767a97$0$1606$c3e8da3$5496439d@news.astraweb.com> <nl5vtk$9nf$1@dont-email.me> |
| Xref | csiph.com comp.lang.python:110910 |
Show key headers only | View raw
On Sat, Jul 2, 2016 at 12:49 AM, BartC <bc@freeuk.com> wrote:
> Why not just extend the capabilities of a class? I actually thought this
> would work until I tried it and it didn't:
>
> class C():
> def fn():
> print ("Hi!")
>
> C.fn()
>
> The error message suggests Python knows what's going on. So why not just
> make it work?
rosuav@sikorsky:~$ python3
Python 3.6.0a2+ (default:57f3514564f6, Jun 29 2016, 16:27:34)
[GCC 5.3.1 20160528] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C():
... def fn():
... print ("Hi!")
...
>>> C.fn()
Hi!
>>>
But if you have two such functions, they can't call each other without
the namespace marker.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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