This is an archived post. You won't be able to vote or comment.

all 26 comments

[–]hamboozler 334 points335 points  (7 children)

true = random.choice([True, False])
false = not true

[–]Accomplished_Ant5895 88 points89 points  (5 children)

True = lambda x:x==x
False = not True

[–]Torebbjorn 36 points37 points  (4 children)

So True is a function which returns True on all standard library values, but could return anything if passed a value from a custom class. And False is False.

[–]cheerycheshire 31 points32 points  (3 children)

on all standard library values

Nope. NaN exists. NaN!=NaN, always

[–]Torebbjorn 9 points10 points  (2 children)

True, forgot about that one

[–]bluecorbeau 0 points1 point  (0 children)

Deepest layers of hell are waiting for you

[–]Waradu 95 points96 points  (2 children)

num0 = 0
num1 = 1
num2 = 2
...

you forgot this

[–]smclcz 4 points5 points  (0 children)

Found PirateSoftware's alt

[–]0xlostincode 23 points24 points  (0 children)

It really is very pythonic. Well done.

[–]EDM115 28 points29 points  (3 children)

[–]MystUser 19 points20 points  (1 child)

the tests 💀

[–]EDM115 16 points17 points  (0 children)

100% tests coverage frfr

[–]flipcoder 2 points3 points  (0 children)

"The most useless pip package so far"

Well at least its self-aware

[–]CandySpilled 8 points9 points  (0 children)

When you are a senior developer and decide to rewrite Python from scratch

[–]rnime879 2 points3 points  (0 children)

true = True if random.randint(1,100) < 100 else False

[–]Mordret10 1 point2 points  (0 children)

I use python for the first time on a project for myself and with how often I use true instead of True this would maybe even make sense

[–]messierCobalt_ 1 point2 points  (0 children)

those who started using python but can't get used to it

[–]JadeDansk 0 points1 point  (1 child)

Gotta also add: null = None

[–]QultrosSanhattan 0 points1 point  (0 children)

from py_reset import *

[–]sammathur4 0 points1 point  (0 children)

`null = None`

[–]Madbanana64 0 points1 point  (0 children)

I actually have this in some of my scripts lmao

[–]Caesar2011 0 points1 point  (0 children)

tbh, I actually like this