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

Question:

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

Asked By: tzot

||

Answers:

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 <>.

Answered By: Lie Ryan

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
Answered By: hynekcer

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

Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.