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
. math
functions return truncated results.math.pi
is 3.- The only boolean is
True
. Expressions that evaluate toFalse
are undefined behavior. - All errors are called
Error
. That means noTypeError
s, noSyntaxError
s, 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
None
is the lyrics of Rick Astley’s Never Gonna Give You Up. - The only variable names are
foo
,bar
,baz
and 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:])