Important questions about __future__

Discussion in 'Python' started by Andrew Berg, Jan 3, 2013.

  1. Andrew Berg

    Andrew Berg Guest

    Does 'from __future__ import barry_as_FLUFL' do anything? Despite PEP
    401, using print as a statement still raises a SyntaxError.
    Where is 'from __future__ import braces' implemented in CPython (it's
    not in __future__.py)?
    --
    CPython 3.3.0 | Windows NT 6.2.9200.16461
    Andrew Berg, Jan 3, 2013
    #1
    1. Advertising

  2. On Thursday, 3 January 2013 14:57:42 UTC+5:30, Andrew Berg wrote:
    > Does 'from __future__ import barry_as_FLUFL' do anything? Despite PEP
    >
    > 401, using print as a statement still raises a SyntaxError.
    >
    > Where is 'from __future__ import braces' implemented in CPython (it's
    >
    > not in __future__.py)?
    >
    > --
    >
    > CPython 3.3.0 | Windows NT 6.2.9200.16461

    barry_as_FLUFL is probably simply a joke future statement (Barry is at the head of Python Development and would probably replace Guido in the future) (Guido is typically only active on python-ideas).
    from __future__ import braces is the Future statement (see http://docs.python.org/3/library/__future__.html)
    import __future__ simply imports __future__.py as a plain, ordinary module
    Ramchandra Apte, Jan 3, 2013
    #2
    1. Advertising

  3. On Thursday, 3 January 2013 14:57:42 UTC+5:30, Andrew Berg wrote:
    > Does 'from __future__ import barry_as_FLUFL' do anything? Despite PEP
    >
    > 401, using print as a statement still raises a SyntaxError.
    >
    > Where is 'from __future__ import braces' implemented in CPython (it's
    >
    > not in __future__.py)?
    >
    > --
    >
    > CPython 3.3.0 | Windows NT 6.2.9200.16461

    barry_as_FLUFL is probably simply a joke future statement (Barry is at the head of Python Development and would probably replace Guido in the future) (Guido is typically only active on python-ideas).
    from __future__ import braces is the Future statement (see http://docs.python.org/3/library/__future__.html)
    import __future__ simply imports __future__.py as a plain, ordinary module
    Ramchandra Apte, Jan 3, 2013
    #3
  4. On Thursday, 3 January 2013 15:13:44 UTC+5:30, Ramchandra Apte wrote:
    > On Thursday, 3 January 2013 14:57:42 UTC+5:30, Andrew Berg wrote:
    >
    > > Does 'from __future__ import barry_as_FLUFL' do anything? Despite PEP

    >
    > >

    >
    > > 401, using print as a statement still raises a SyntaxError.

    >
    > >

    >
    > > Where is 'from __future__ import braces' implemented in CPython (it's

    >
    > >

    >
    > > not in __future__.py)?

    >
    > >

    >
    > > --

    >
    > >

    >
    > > CPython 3.3.0 | Windows NT 6.2.9200.16461

    >
    > barry_as_FLUFL is probably simply a joke future statement (Barry is at the head of Python Development and would probably replace Guido in the future) (Guido is typically only active on python-ideas).
    >
    > from __future__ import braces is the Future statement (see http://docs.python.org/3/library/__future__.html)
    >
    > import __future__ simply imports __future__.py as a plain, ordinary module


    Link should have been http://docs.python.org/3/reference/simple_stmts.html#future

    ---
    Happy, new, joyful, etc new boring year.
    Ramchandra Apte, Jan 3, 2013
    #4
  5. On Thursday, 3 January 2013 15:13:44 UTC+5:30, Ramchandra Apte wrote:
    > On Thursday, 3 January 2013 14:57:42 UTC+5:30, Andrew Berg wrote:
    >
    > > Does 'from __future__ import barry_as_FLUFL' do anything? Despite PEP

    >
    > >

    >
    > > 401, using print as a statement still raises a SyntaxError.

    >
    > >

    >
    > > Where is 'from __future__ import braces' implemented in CPython (it's

    >
    > >

    >
    > > not in __future__.py)?

    >
    > >

    >
    > > --

    >
    > >

    >
    > > CPython 3.3.0 | Windows NT 6.2.9200.16461

    >
    > barry_as_FLUFL is probably simply a joke future statement (Barry is at the head of Python Development and would probably replace Guido in the future) (Guido is typically only active on python-ideas).
    >
    > from __future__ import braces is the Future statement (see http://docs.python.org/3/library/__future__.html)
    >
    > import __future__ simply imports __future__.py as a plain, ordinary module


    Link should have been http://docs.python.org/3/reference/simple_stmts.html#future

    ---
    Happy, new, joyful, etc new boring year.
    Ramchandra Apte, Jan 3, 2013
    #5
  6. On Thu, 03 Jan 2013 03:27:42 -0600, Andrew Berg wrote:

    > Does 'from __future__ import barry_as_FLUFL' do anything?


    Yes, it re-enables <> and disables != as not equal:

    py> sys.version
    '3.3.0rc3 (default, Sep 27 2012, 18:44:58) \n[GCC 4.1.2 20080704 (Red Hat
    4.1.2-52)]'
    py> 1 <> 2
    File "<stdin>", line 1
    1 <> 2
    ^
    SyntaxError: invalid syntax
    py> from __future__ import barry_as_FLUFL
    py> 1 <> 2
    True


    > Where is
    > 'from __future__ import braces' implemented in CPython (it's not in
    > __future__.py)?


    It's defined in the C source code for the CPython compiler. Look in
    future.c.

    http://hg.python.org/cpython/file/944e86223d1f/Python/future.c




    --
    Steven
    Steven D'Aprano, Jan 3, 2013
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Logan
    Replies:
    3
    Views:
    758
    Michael Hudson
    Nov 25, 2003
  2. Jacek Generowicz

    from __future__ import decorators

    Jacek Generowicz, Jan 13, 2005, in forum: Python
    Replies:
    8
    Views:
    365
    Jacek Generowicz
    Jan 17, 2005
  3. Replies:
    3
    Views:
    340
  4. Replies:
    2
    Views:
    303
  5. Ian Kelly
    Replies:
    0
    Views:
    118
    Ian Kelly
    Jan 3, 2013
Loading...

Share This Page