JSFuck, JJencode... There are many projects that writes JavaScript with only symbols.
but, python is not.
It's simple, python's types are stricter than JavaScript's.
For example, in JavaScript, you can do "toString" method with just concatenate Array or String.
1+[] => "1"
""+500 => "500"But, in python...
1+[] => TypeError: unsupported operand type(s) for +: 'int' and 'list'
""+500 => TypeError: can only concatenate str (not "int") to strand there're more reason that makes hard to write python with only symbols.
You can get properties or methods like JSON in JavaScript.
"abc"["length"] => 3
(3)["toString"] => function toString...It doesn't work in python, too.
You can get attributes with str by using getattr function, but you have to get the getattr function with only symbols. (its nearly or literally impossible)
Now, i can write any python code with this subset: exc("+>%)
First, you can make True/False with: "+">"", "">"".
In python, bool is a subclass of int.
It makes this possible:
+True => 1
+False => 0
+("+">"") => 1Congratulations, we got ints with only symbols!
Now, you can get any positive int: 1+1+1+...
Now we are going to get str.
But unfortunately, here's the first wall. (first part to use chars that isn't symbols...)
In python, you can make chars from int with:
"%c" % ascii_charcodeSo, we can get any str with:
"%c"%(+("+">"")+("+">"")+("+">"")+...)But, it is so difficult, or impossible to find the way to get "c" with only symbols. (that's why i made this repo, i need your help)
# idk are these will be useful, but here's something maybe can make "c":
type("") => str
type("")(type("")) => str(str) => "<class 'str'>"
type("")(type(""))[1] => "c"
# You have to get type function, str function or <class 'str'> with only symbols.
# or, you can use octal escape
"\143" => "c"
# But it's useless because you have to eval this, getting eval function and backslash is way too hardNow, we got strs, so its time to execute them!
exec("%c"%(+("+">"")+("+">"")+("+">"")+...))... Here's the second wall..., How we can get the exec function?
... Of course, this is way too harder than getting "c". There's high probability that it's literally impossible.
So, Now i have 2 huge walls to write python with only symbols.
If you have a genius idea, please share me!
You don't have to stick to use subset like exc("+>%), If you can write python with only symbols, Even if your subset is completely different, It's a big step.