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


Groups > comp.lang.python > #66749

Re: Commonly-used names in the Python standard library

References <mailman.7178.1392889158.18130.python-list@python.org> <87mwhm6q3e.fsf@elektro.pacujo.net> <mailman.7181.1392893048.18130.python-list@python.org> <87eh2y6n1d.fsf@elektro.pacujo.net>
Date 2014-02-20 22:47 +1100
Subject Re: Commonly-used names in the Python standard library
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.7183.1392896857.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Feb 20, 2014 at 10:28 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Chris Angelico <rosuav@gmail.com>:
>
>> On Thu, Feb 20, 2014 at 9:22 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
>>>   py35.unless x > 7:
>>>       return
>>
>> What about return? Are you allowed to namespace that? And 'from' and
>> 'import' and '*'?
>
> Old keywords are guaranteed not to clash with programs. Introducing new
> keywords runs that risk. Hence, C had to introduce the ugly _Bool
> keyword.

Okay, so what you're saying is that there are three states:

Before Python X.Y, the unless keyword simply doesn't exist. (It can't
be coded in as a module, so it can't exist until someone implements
the code.)

>From X.Y, it can be called up by importing it from "pyAB" and used in
its namespace.

>From A.B onward, it always exists.

Python has a facility like this. It doesn't namespace the keywords,
but it does let you choose whether to have them or not. In Python 2.5,
you could type "from __future__ import with_statement" to turn 'with'
into a keyword. After Python 2.6, it's always a keyword.

ChrisA

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


Thread

Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 20:39 +1100
  Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 12:22 +0200
    Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 21:43 +1100
      Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 13:28 +0200
        Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 22:37 +1100
        Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 22:47 +1100
          Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 14:09 +0200
            Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-20 23:19 +1100
              Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 14:46 +0200
                Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 00:34 +1100
                Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 17:14 +0200
                Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 02:48 +1100
                Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-20 18:26 +0200
                Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 03:36 +1100
                Re: Commonly-used names in the Python standard library 88888 Dihedral <dihedral88888@gmail.com> - 2014-02-21 12:57 -0800
                Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:49 +0000
            Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:43 +0000
    Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:59 +0000
      Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 18:10 +1100
      Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-21 09:21 +0200
        Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 19:21 +1100
          Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-21 12:26 +0200
            Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 21:49 +1100
              Re: Commonly-used names in the Python standard library Marko Rauhamaa <marko@pacujo.net> - 2014-02-21 14:03 +0200
                Re: Commonly-used names in the Python standard library Ethan Furman <ethan@stoneleaf.us> - 2014-02-21 11:16 -0800
        Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 09:12 +0000
  Re: Commonly-used names in the Python standard library Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-21 06:51 +0000
    Re: Commonly-used names in the Python standard library Chris Angelico <rosuav@gmail.com> - 2014-02-21 18:02 +1100

csiph-web