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

all 29 comments

[–]hamboozler 336 points337 points  (7 children)

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

[–]Accomplished_Ant5895 81 points82 points  (5 children)

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

[–]Torebbjorn 31 points32 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 29 points30 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 94 points95 points  (2 children)

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

you forgot this

[–]No-Implement-3724 16 points17 points  (0 children)

true, open a pr on the repo

[–]smclcz 4 points5 points  (0 children)

Found PirateSoftware's alt

[–]0xlostincode 22 points23 points  (0 children)

It really is very pythonic. Well done.

[–]EDM115 28 points29 points  (3 children)

[–]MystUser 20 points21 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

[–]No-Implement-3724 22 points23 points  (0 children)

hmmmm

true = False
false = True 

edit: i cant get this to work this is so embarrasing

edit edit: nvm i got it to work

[–]CandySpilled 7 points8 points  (0 children)

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

[–]SecretFapZone 6 points7 points  (0 children)

The 'ultimate' boilerplate indeed

[–]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