Python but it's trash
Jump to navigation
Jump to search
I am User:LEOMOK, here to make Python trash.
How I made it trash
This programming language is exactly the same as normal Python, but:
- The underscore
_is not allowed, even in strings. Same for expressions and escape codes that produce an underscore, such as\u005f. - All integers are 32 bit. There are no floats. Also, the only numeric literal is
0. mathfunctions return truncated results.math.piis 3.- The only boolean is
True. Expressions that evaluate toFalseare undefined behavior. - All errors are called
Error. That means noTypeErrors, noSyntaxErrors, justError. - The
==operator is undefined. - String literals may not contain whitespace, unless if that’s all it contains.
- Lists may not contain three instances of the same item, unless the list contains exactly three items.
- The stringification of
Noneis the lyrics of Rick Astley’s Never Gonna Give You Up. - The only variable names are
foo,bar,bazand single characters.
Examples
print("Hello,"+" "+"world!")
print(None)
Unbounded integer class (since PBIT’s integers are only 32 bit, does not support negative numbets)
class I:
self.v = [] #initial value 0
def i(self): #increment
return I(self+[[]])
def d(self): #decrement
return I(self[not 0:])