So what exactly does “from __future__ import barry_as_FLUFL” do?

PythonOperators

Python Problem Overview


I understand it's an inside joke that's meant to stay (just like “from __future__ import braces”), but what exactly does it do?

Python Solutions


Solution 1 - Python

It's related to PEP 0401: BDFL Retirement

Barry refers to Barry Warsaw, a well-known Python developer. The from __future__ import barry_as_FLUFL basically replaces the != operator with <>.

Solution 2 - Python

As mentioned above, barry is Barry Warsaw, a well known Core Python Dev However, the FLUFL has not been explained

It stands for "Friendly Language Uncle For Life" an inside joke among the other python core devs at the time. The reason this enables the <> syntax, is that he was the primary person who wanted to use the <> operator

Solution 3 - Python

The April Fool's joke PEP 0401 is really funny and so its current implementation. It works very good interactively from the terminal or by python3 -i from the standart input, but surprisingly not from a normal script or without -i. It works by eval(...) or by compile(..) this way:

exec(compile('1<>0', 'foo', 'single', __future__.CO_FUTURE_BARRY_AS_BDFL))
True

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontzotView Question on Stackoverflow
Solution 1 - PythonLie RyanView Answer on Stackoverflow
Solution 2 - PythonMicroTransactionsMatterTooView Answer on Stackoverflow
Solution 3 - PythonhynekcerView Answer on Stackoverflow