Article 45D17 Representative Line: Explicitly True

Representative Line: Explicitly True

by
Remy Porter
from The Daily WTF on (#45D17)

Part of Python's appeal is its rich class library. The old XKCD about import antigravity sometimes doesn't feel that far off. Combined with a few third-party libraries, like NumPy, you can do a lot with very little code.

Of course, that feels a bit like magic. As Python gurus like to say, "Explicit is better than implicit". One of Mark's co-workers took this perhaps a bit too far, when they started adding this import to every file:

from __builtin__ import True

As you might imagine from a name like __builtin__, everything in that namespace, including True, is imported by default. Mark found this "among other useless stuff". One has to wonder: how much useless stuff.

buildmaster-icon.png [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today! TheDailyWtf?d=yIl2AUoC8zAue1bB5RBxyI
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments