Important questions about __future__

A

Andrew Berg

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)?
 
R

Ramchandra Apte

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)?
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
 
R

Ramchandra Apte

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)?
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
 
R

Ramchandra Apte

R

Ramchandra Apte

S

Steven D'Aprano

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top