#esoteric-python
1 messages · Page 54 of 1
isinstance should probably be appended to the list as well.
map() too
https://earthy-shrimp-457.notion.site/veritas-mutable-defaults-to-lambda-classes-24147640429a809ba1ced30cdbe320a4 have a read yall
This is awesome
To avoid, I like instead of
def append(item, to=[]):
Use
def append(item, to=None):
if to is None:
to = []
...
That's my K.I.S.S. version, curious if others have a nicer pattern ?
def append(item, to=None):
to = to or []
...
i personally use lambdas with mutable defaults as the mutable default of a def
this is the correct pattern lmao, I was just messing around
a=[]; append(1, a) won't work though
can't you do
to = to if to else []
Often yes (or to = to or []), but not if falsy-non-Nones matter
Why can't we do to or= [] 
!e
def foo(a=None):
a = a or []
a.append(1)
x = []
foo(x)
print(x)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
[]
what's good here?
this is really cute
✨
to=[to,[]][to is None]
!e py def append(item, to: list = (not_given := object())): if to is not_given: to = [] ...
:warning: Your 3.13 eval job has completed with return code 0.
[No output]
has there been much progress on decomp?
this doesn't look cursed at all, just a sentinel
Hey guys!
Does anyone know why my code wont stop when I use the stop function?
import queue
import threading
stop = threading.Event()
speech_queue = queue.Queue()
def stop_tts():
stop.set()
def turn_tts_on():
stop.clear()
def speak_worker():
global engine
engine = pyttsx3.init()
engine.setProperty("voice", r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0")
def onStartWord(name, location, length):
if stop.is_set():
engine.stop()
engine.connect('started-word', onStartWord)
while True:
text = speech_queue.get()
if text is None:
break
engine.say(text)
engine.runAndWait()
speech_queue.task_done()
def start_speaking_service():
thread = threading.Thread(target=speak_worker, daemon=True)
thread.start()
def add_to_speaking_queue(text):
speech_queue.put(text)```
This isn't #1035199133436354600
what's the name of the variable where the global interpreter state is stored
I'm trying to debug
PyThreadState *_Py_tss_tstate; ?
there's probably a simpler expression than _Py_tss_tstate[0].interp[0]._initial_thread.base.current_frame[0]
_Py_tss_tstate.current_frame works lol
interestingly sometimes _Py_tss_tstate is null, but _Py_tss_gilstate is not
If I ever have to debug this again I'd rather rewrite everything from the ground up
I'm curious how you used the staticmethod defined at the class level, is it because it doesn't need an instance/class parameter that it works?
I've debugged classes like this and wishI could select and hide them from the debugger
I guess you could move those to an XXXStatics class or something, but it doesn't seem like a great solution
I found one of my python gdb scripts but it appears as though newlines have been replaced by '>' or something..
oh I also had printdict3 which is generic and I wrote another generic one for python today lol
it got stuck recursing the sys module through sys.modules
I was trying to do something with metaclasses to make pattern matching choose correctly among tuple and list lol
Don't Scan 😉
<@&831776746206265384>
Ah shit it's just a qr code generator
Nothing malicious, carry on
It's very sus to send a random QR code though lmao
Sure.. I did check it earlier. But this is #esoteric-python after all

;-;
😂 I thought I was creative to post it like that
Well it kinda was 

Made them that way to forbid modifying class parameters while parsing
I almost began accessing properties while sanitizing Obsidian note filenames, and that saved me
Make a code such that it use the qrcode library, such that it would open a QR-code image where the content of the QR-code is itself. You cannot read/rely external source to generate the QR code except the 2 library
a
hard challenge innit...
hmm
e
okay testing done
trying to do this with discord snowflakes is a bit hard-
hlw every one
print("nohtypetahI"[::-1])
print("Yes" * True + "No" * False)
print(chr(sum(range(80)))) # Prints 'P'
print(__import__('base64').b64decode('SGVsbG8gd29ybGQh').decode())
import this```
print((True + True) * (True + True + True)) # 6
print([*__import__('pathlib').Path('.').iterdir()])
!e print(chr(sum(range(80))))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
ౘ
chr(80) is P but even if you do max(range(80)) that would be 79 (O)
I’m confused on what this means. Is it just have a QR code that’s embed data is the QR code itself? Since that doesn’t sound like much of a challenge. Or does it actually have to open a page/launch an application that would display the QR code’s source code human readably? Or something else?
Well, the code given also do PIL open, so that
!e print(chr(sum(range(ord(min(str(not())))))))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
ඞ
What is that sign? idk actually lol
!charinfo ඞ
\u0d9e : SINHALA LETTER KANTAJA NAASIKYAYA - ඞ
oh lol
oh that's an interesting idea
so the content of the QR code data is supposed to be the program itself?
kind of like a QR quine if QR codes could execute (calling it "QR code" is kinda funny)
another challenge idea
shortest code to crash from stack recursion?
!e here's my attempt
(a := (lambda: a()))()```
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | [31m(a := (lambda: a()))[0m[1;31m()[0m
004 | [31m~~~~~~~~~~~~~~~~~~~~[0m[1;31m^^[0m
005 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<lambda>[0m
006 | (a := (lambda: [31ma[0m[1;31m()[0m))()
007 | [31m~[0m[1;31m^^[0m
008 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<lambda>[0m
009 | (a := (lambda: [31ma[0m[1;31m()[0m))()
010 | [31m~[0m[1;31m^^[0m
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/J63TJHOFOPHNHNYGKLDDZU2MVM
you can shave off the 3 whitespaces
lol true I forgot about that
oh there's a pair of unneeded parens too
!e
(a:=lambda:a())()```
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | [31m(a:=lambda:a())[0m[1;31m()[0m
004 | [31m~~~~~~~~~~~~~~~[0m[1;31m^^[0m
005 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<lambda>[0m
006 | (a:=lambda:[31ma[0m[1;31m()[0m)()
007 | [31m~[0m[1;31m^^[0m
008 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<lambda>[0m
009 | (a:=lambda:[31ma[0m[1;31m()[0m)()
010 | [31m~[0m[1;31m^^[0m
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/FQT3R7WBUKHRFTI4WD4II7MQEM
oh no don't tell me the lambda is longer
!e
print(len("(a:=lambda:a())()"))
print(len("""def a():a()
a()"""))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 17
002 | 15
yep
I don't think you can improve then
hmm yeah quite possibly lol
it is funny you figured out the most straightforward way was the shortest
!e
def a():a()
You need to also call it.
Yes
So ... I can create lists and tuples and dicts and all that, right? And store those values in variables and expand them to call functions and all that. But is there a single/flat data type that can store "rich" function-args? The *args, **kwargs can be represented by a tuple[list, dict] pair but in code it's written out like a single flat object. Does any such object actually exist? Or would be need to be a pair?
The functools.partial example uses a nested function which it adds func.args = ...; func.keywords = kwargs but that's rather clunky. There's unittest.mock.call which looks like a tuple wrapper. I guess it'd just have to be a wrapper, I suppose...
instead of a pair it could be the other way around
[(arg,), (arg,), (kwkey, kwval), ...]
imagine zipping things
Yeah. That would also work, but that's also a bit clunky. I was hoping there would be some way to use the call style syntax to make a list of call args then make the calls in a loop ... but that might not be possible. Unless, of course, I switch my calls to not use kwargs. I could use an actual dict. But the a=b syntax is easier to work with. I could wrap that in a dict() but I'm trying to reduce things here so the data has less code in it.
I'm half tempted to just store the data in one big multiline string and parse out the args from it.
It sorta feels like I'm trying to write a bespoke macro language. Which is not entirely incorrect.
i'm not getting this..
lol. I got it to work, though 😄
If you have the functions pre-defined, you can wrap them in inspect.signature and then call <Signature object>.bind(...) using the standard function call syntax
then to use the bound arguments you can call the original function with the resulting .args and .kwargs
i discovered for half by accident that sys._debugmallocctats exists lol
mallocstats even
i wonder why it says like x tuples free
does it keep track of the space for a particular object type and reuse it?
i guess it's taking about pymalloc
could you copy paste and example?
omg
!e
import sys
sys._debugmallocstats()```
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | Small block threshold = 512, in 32 size classes.
002 |
003 | class size num pools blocks in use avail blocks
004 | ----- ---- --------- ------------- ------------
005 | 0 16 1 65 956
006 | 1 32 2 736 284
007 | 2 48 10 3374 26
008 | 3 64 23 5833 32
009 | 4 80 20 3976 104
010 | 5 96 3 435 75
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/6CGFVGIRASTSFXFR642DNP7MCI
its extremely readable code
uhh gives me a type error somewhere
it won't work on latest python, its very environment dependent - you need to be on the same python version and operating system for it to work properly
guess i'll have to make my own
apparently
import pywhatkit as kt
img_loc = input("Enter the image location: ")
kt.image_to_ascii_art(img_loc, "ascii_text.txt")
Image --> ASCII Art
!e ```py
from future import annotations
from inspect import signature
__me = "yes"
_A__me = "no"
class A:
def a(s):
global __var
__var = "__val"
print(__me)
def __inner(__arg: __Arg) -> __Ret: pass
return __inner
print(signature(A().a()), _A__var)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | no
002 | (_A__arg: '__Arg') -> '__Ret' __val
Name mangling is weird.
!e ```py
from inspect import signature
__me = "yes"
_A__me = "no"
class A:
def a(s):
global __var
__var = "__val"
print(__me)
def __inner(__arg: __me) -> __me: pass
return __inner
print(signature(A().a()), _A__var)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | no
002 | (_A__arg: 'no') -> 'no' __val
Click here to see this code in our pastebin.
!e
(_:=__builtins__.__dir__().__len__().__floordiv__(__name__.__dir__().__len__()),__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__builtins__.__dir__().__len__().__floordiv__(_.__add__(_.__add__(_.__add__(_)))).__add__(_).__add__(_).__add__(_)))(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__loader__.__dir__().__len__().__add__(__import__.__dir__().__len__())))().join(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__loader__.__dir__().__len__().__add__(__doc__.__dir__().__len__()).__sub__(__name__.__dir__().__len__().__floordiv__(__import__.__dir__().__len__()))))(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(_.__sub__(__name__.__dir__().__len__().__floordiv__(__import__.__dir__().__len__())))).__dir__().__len__().__rshift__(_).__sub__(_))), (__doc__.__dir__().__len__().__lshift__(_.__add__(_)).__add__(_.__lshift__(_.__add__(_))),)))))
h
:white_check_mark: Your 3.14 pre-release eval job has completed with return code 0.
h
!e
(_:=__builtins__.__dir__().__len__().__floordiv__(__name__.__dir__().__len__()),__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__builtins__.__dir__().__len__().__floordiv__(_.__add__(_.__add__(_.__add__(_)))).__add__(_).__add__(_).__add__(_)))(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__loader__.__dir__().__len__().__add__(__import__.__dir__().__len__())))().join(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__loader__.__dir__().__len__().__add__(__doc__.__dir__().__len__()).__sub__(__name__.__dir__().__len__().__floordiv__(__import__.__dir__().__len__()))))(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(__builtins__.__getattribute__(__builtins__.__dir__().__getitem__(_.__sub__(__name__.__dir__().__len__().__floordiv__(__import__.__dir__().__len__())))).__dir__().__len__().__rshift__(_).__sub__(_))), ((__:=__doc__.__dir__().__len__().__lshift__(_.__add__(_))).__add__(_.__lshift__(_.__add__(_))),__.__add__(_),__.__add__(_.__lshift__(_.__add__(_).__add__(_))).__add__(_).__add__(_),__.__add__(_.__lshift__(_.__add__(_).__add__(_))),__.__add__(__import__.__dir__().__len__().__rshift__(_).__sub__(_.__lshift__(_.__add__(_)))),_.__lshift__(_.__lshift__(_.__add__(_)).__add__(_)),__.__rshift__(_).__add__(_.__lshift__(_.__add__(_).__add__(_))),__.__rshift__(_).__add__(_))))))```
:white_check_mark: Your 3.14 pre-release eval job has completed with return code 0.
henlo :3
henlo :3
That is absolutely mindboggling.
IOPCC when
this is part of a whole series of hellos uh wait a second
they break after every update so it has to be rewritten every year
.bm imma bm this
this one is one of the shorter ones but imo one of the more confusing ones
no magic numbers/strings
Your dedication is admirable
its called "having too much free time"
Does anyone know how to get the return value from within a finally?
def foo():
try:
return 9
finally:
...
foo()
I tried some frame stuff, but it didn't seem to have it, but maybe I missed it
maybe you could use a bit of ctypes to access the stack pointer of the frame?
https://github.com/python/cpython/blob/main/Python/executor_cases.c.h#L1918-L1940
from sys._getframe(0) you could get its ->f_frame which should be https://github.com/python/cpython/blob/main/Include/internal/pycore_frame.h#L18-L21 offset by 3 pointers,
then its https://github.com/python/cpython/blob/main/Include/internal/pycore_interpframe_structs.h#L39 stackpointer should be offset by 8 pointers
Include/internal/pycore_frame.h lines 18 to 21
struct _frame {
PyObject_HEAD
PyFrameObject *f_back; /* previous frame, or NULL */
_PyInterpreterFrame *f_frame; /* points to the frame data */```
Humm, ngl I thought there would be an API for this. I have never tried accessing these directly. I think I am not doing it correctly, because when I run:
def foo():
try:
return 9
finally:
frame = sys._getframe()
frame_addr = id(frame)
print(id(frame.f_back))
print((c_void_p * 4).from_address(frame_addr)[1])
foo()
I get different addresses on stdout, shouldn't these be the same? Also [2] is None so I am definitly doing something wrong
Ok, so I guess the NULL was expected above, but this is as far as I could go:
!e
import sys
from ctypes import c_void_p
import ctypes
def foo():
try:
return 9
finally:
frame = sys._getframe()
frame_addr = id(frame)
inter_frame_addr = (c_void_p * 4).from_address(frame_addr)[3]
inter_frame = (c_void_p * 16).from_address(inter_frame_addr)
assert frame_addr == inter_frame[6] # sanity check
stackpointer_addr = inter_frame[8]
print(stackpointer_addr)
return_ptr = c_void_p.from_address(stackpointer_addr).value
print(return_ptr)
print(c_void_p.from_address(stackpointer_addr).value)
foo()
:white_check_mark: Your 3.14 pre-release eval job has completed with return code 0.
001 | 140593303658768
002 | 1
003 | 140593303304736
I realized earlier that I was in the wrong version for the code you provided
Not sure why those last two are different, and any attempt at casting them to py_object leads to a seg faul x)
What's the thinking process for doing these?
dunder spam
nothing but dunders
only dunder
yeah but
how do you manage to join dunders into an actual output
yeah
yeah
thats basically it
ok bro
i take dir(__builtins__) by doing __builtins__.__dir__() which is a list of all of them
and then i use __builtins__.__getattribute__("func") to get __builtins__.func
the only real hard part of it is getting the correct element from dir(__builtins__) but i just use the lenghts of the dirs of other dunders in builtins to get the indexes which is also why one that works for one version usually wont work for another
ok let me try
I just feel like dropping this in here ```py
j=lambda m,d,l=0:275m//9-30+d-(2-int(l))(m>2)
wut is it for?
calculating day of the year
january 1 is 1, february 2 is 33 and so on
I found the equation in a research paper and I like it
.latex $$J = \frac{275 * M}{9} - 30 + D + X$$
.latex $$J = \frac{275 * M}{9} - 30 + D + X$$
honestly not sure why that's not enabled here
X is 0 for first 2 months
After february, X is -1 for leap years and -2 otherwise
l is just 0 and 1?
orr..
boolean or 0 or 1
anything else will break the code
it can be a string?
no
i see
It can be a string but only "0" or "1" (may still add spaces on either side though)
it can also be "0_0"
etc
wtf is going on here, why do some of these throw a NameError: g is not defined but not all
only on python 3.11, on python 3.12 they all work fine
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g))for j in range(len(g[0]))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g[0]))for j in range(len(g))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g))for j in range(len(g))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g[0]))for j in range(len(g[0]))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g))for j in range(3)]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(3)for j in range(len(g))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(3)for j in range(len(g[0]))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g[0]))for j in range(3)]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(3)for j in range(3)]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(len(g[0]))]and g
p([[0]])
p=lambda g:[exec("g[0][0]+=1")for i in range(3)]and g
p([[0]])
exec() has a separate scope
oh. i see
3.11 does not inline listcomps, so they're called in a separate function made by the python bytecode compiler and therefore the g variable (only local to the enclosing lambda itself) is unresolvable
3.12+, on the other hand, inlines listcomps and therefore allows accessing g as a local variable in the enclosing lambda scope
in other words, this is how 3.11 works ```py
def _listcomp():
_ = []
for i in range(3):
_.append(exec("g[0][0]+=1"))
return _
def p(g):
return _listcomp()and g
p([[0]])
and this is how 3.12+ works ```py
def p(g):
_ = []
for i in range(3):
_.append(exec("g[0][0]+=1"))
return _ and g
p([[0]])
i see, that explains the version discrepancy
why is it inconsistent in 3.11 rather than consistently NameError?
it should be consistent, but i'm gonna test..
it's because the inner loop j captures g and brings it into the local listcomp scope for 3.11
when that inner loop either
- doesn't exist
- doesn't use
g
thenexec()can't resolvegin the local scope and treats it as a global, thus theNameError
why doesn't this happen for the outer loop?
because the outer loop's iterable is evaluated in the enclosing lambda scope instead of the listcomp scope
ohh i see
thanks, makes sense
I see the pattern now, thanks
more accurate 3.11 example ```py
def p(g):
def _listcomp(_0):
_ = []
for i in _0:
for j in range(len(g[0])):
_.append(exec("g[0][0]+=1"))
return _
return _listcomp(range(len(g))and g
p([[0]])
Thanks so much for your help by the way!
Hi
New challenge:
Did you know that you can get compile-time recursion error?
My PB: ||5985bytes||
recursion error as in..?
details?
you mean when it's creating the bytecode?
I wish to experience said compile-time error
!e
exec("+".join("1" for _ in range(1002)))
:warning: Your 3.13 eval job has completed with return code 0.
[No output]
:warning: Your 3.13 eval job has completed with return code 0.
[No output]
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | [31mexec[0m[1;31m("+".join("1" for _ in range(29940)))[0m
004 | [31m~~~~[0m[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[0m
005 | [1;35mRecursionError[0m: [35mmaximum recursion depth exceeded during compilation[0m
Ok,so it might be different per platform? Great
!e exec("+"*5969+"1")
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | [31mexec[0m[1;31m("+"*5969+"1")[0m
004 | [31m~~~~[0m[1;31m^^^^^^^^^^^^^^[0m
005 | [1;35mMemoryError[0m: [35mParser stack overflowed - Python source too complex to parse[0m
technically 5970
I got 2994 on my phone with this
And this is 2993 on my phone
Just weird 🥴
(do note that it's pydroid
works differently for different platforms, i guess.
Wait that was memory 🤔
!e
exec("+".join("1" for _ in range(5970)))
:warning: Your 3.13 eval job has completed with return code 0.
[No output]
...
oh, yea
this one's on the AST
depends on the actual C stack
long binary operations, for some reason, pass the parsing stage
and get to the AST processing stage to cause a recursion error
Oh well
!e ```py
exec("+".join("x"*9997))
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | [31mexec[0m[1;31m("+".join("x"*9997))[0m
004 | [31m~~~~[0m[1;31m^^^^^^^^^^^^^^^^^^^^[0m
005 | [1;35mRecursionError[0m: [35mmaximum recursion depth exceeded during compilation[0m
i guess it is sort of a compile time recursion error
Platform dependence is a bit disappointing, but I should expect it...
it would make string operations nicer
i think ive mentioned wanting something like that in #python-discussion somewhere once
Okay but does it chain
this could work for chaining```py
def str_multireplace(s, *args):
if len(args) % 2:
raise ValueError
for s1, s2 in zip(args[::2], args[1::2]):
s = s.replace(s1, s2)
return s
interesting, this seems to use the same thing that is used for regular calls (_PyEnterRecursiveCall (which calls _Py_EnterRecursiveCallTstate) or _Py_EnterRecursiveCallTstate directly)
hm, no, calling sys.setrecursionlimit doesn't seem to affect anything
well, there's .translate() for single characters, and albeit controversial re.sub() function for more complex replacements...
Python/ast_opt.c lines 1121 to 1124
int recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining;
starting_recursion_depth = recursion_depth;
state.recursion_depth = starting_recursion_depth;
state.recursion_limit = Py_C_RECURSION_LIMIT;```
Include/cpython/pystate.h line 226
# define Py_C_RECURSION_LIMIT 10000```
makes sense, thanks!!
Is there a way to error handling in inline expressions in python?
put it in a function..?
do you mean a try except but as an expression instead of a statement?
something can be imported and made use of, iirc it was contextlib
there is or was this tool that could one-line a python 2 code
!e
(lambda _, __, ___, ____:
eval(''.
join([bytes([_____]).
decode() for
_____\
in [(____+((___<<___<<_)-(___<<_))),(____+((___<<___<<_)-___)),
(____+(___<<_)+_),(____+((___<<___<<_)-(___<<___))+(___)),
(____+(___<<___<<_)),((___<<___)+(___<<___<<___)),((___<<___<<___)+___),
(____+(___<<_)),(____+_),(____+(___<<___)),(____+(___<<___)),
(____+(___<<___)+___+_),(___<<___<<___),(____+(___<<___<<_)+
(___+_)),(____+(___&___&___^_|___)+(___|_|__+___)+
(___|_)+___),(____+(___<<___<<_)-(___+___<<_)+
(___<<___)-___),(____+(___<<___)),____,
((___<<___<<___)+___),((___<<___<<___)+(___<<___)+_)]]))
)(_:=([([map(int,
(__builtins__.len({}.__iter__.
__repr__.__subclasshook__.
__init__.__name__).__subclasshook__.
__init__).__str__())])]!=
{...==...:[...,...][0:[]!=[]==[
{}.__iter__.__subclasshook__]]}),__:=~-_,(_<<(_^__)), ((((((_ << _ << _)
>> __ >> __ >> __) **
(_ << _ << _)) >> _)-(_
<< _ << _ << _ << _ << _)+(_<<_<<_))))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
hello world
!e
(
lambda _, __, ___, ____: eval(
"".join(
[
bytes([_____]).decode()
for _____ in [
(____ + ((___ << ___ << _) - (___ << _))),
(____ + ((___ << ___ << _) - ___)),
(____ + (___ << _) + _),
(____ + ((___ << ___ << _) - (___ << ___)) + (___)),
(____ + (___ << ___ << _)),
((___ << ___) + (___ << ___ << ___)),
((___ << ___ << ___) + ___),
(____ + (___ << _)),
(____ + _),
(____ + (___ << ___)),
(____ + (___ << ___)),
(____ + (___ << ___) + ___ + _),
(___ << ___ << ___),
(____ + (___ << ___ << _) + (___ + _)),
(
____
+ (___ & ___ & ___ ^ _ | ___)
+ (___ | _ | __ + ___)
+ (___ | _)
+ ___
),
(____ + (___ << ___ << _) - (___ + ___ << _) + (___ << ___) - ___),
(____ + (___ << ___)),
____,
((___ << ___ << ___) + ___),
((___ << ___ << ___) + (___ << ___) + _),
]
]
)
)
)(
_ := (
[
(
[
map(
int,
(
__builtins__.len(
{}.__iter__.__repr__.__subclasshook__.__init__.__name__
).__subclasshook__.__init__
).__str__(),
)
]
)
]
!= {... == ...: [..., ...][0 : [] != [] == [{}.__iter__.__subclasshook__]]}
),
__ := ~-_,
(_ << (_ ^ __)),
(
(
((((_ << _ << _) >> __ >> __ >> __) ** (_ << _ << _)) >> _)
- (_ << _ << _ << _ << _ << _)
+ (_ << _ << _)
)
),
)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
hello world
!e
(
lambda _, __, ___, ____: eval(
"".join(
[
bytes([_____]).decode()
for _____ in [
(____ + ((___ << ___ << _) - (___ << _))),
(____ + ((___ << ___ << _) - ___)),
(____ + (___ << _) + _),
(____ + ((___ << ___ << _) - (___ << ___)) + (___)),
(____ + (___ << ___ << _)),
((___ << ___) + (___ << ___ << ___)),
((___ << ___ << ___) + ___),
(____ + (___ << _)),
(____ + _),
(____ + (___ << ___)),
(____ + (___ << ___)),
(____ + (___ << ___) + ___ + _),
(___ << ___ << ___),
(____ + (___ << ___ << _) + (___ + _)),
(
____
+ (___ & ___ & ___ ^ _ | ___)
+ (___ | _ | __ + ___)
+ (___ | _)
+ ___
),
(____ + (___ << ___ << _) - (___ + ___ << _) + (___ << ___) - ___),
(____ + (___ << ___)),
____,
((___ << ___ << ___) + ___),
((___ << ___ << ___) + (___ << ___) + _),
]
]
)
)
)(True, 0, 2, 100)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
hello world
!e
print(
''.join([bytes([_____]).decode() for _____ in [100 + ((2 << 2 << True) - (2 << True)), 100 + ((2 << 2 << True) - 2), 100 + (2 << True) + True, 100 + ((2 << 2 << True) - (2 << 2)) + 2, 100 + (2 << 2 << True), (2 << 2) + (2 << 2 << 2), (2 << 2 << 2) + 2, 100 + (2 << True), 100 + True, 100 + (2 << 2), 100 + (2 << 2), 100 + (2 << 2) + 2 + True, 2 << 2 << 2, 100 + (2 << 2 << True) + (2 + True), 100 + (2 & 2 & 2 ^ True | 2) + (2 | True | 0 + 2) + (2 | True) + 2, 100 + (2 << 2 << True) - (2 + 2 << True) + (2 << 2) - 2, 100 + (2 << 2), 100, (2 << 2 << 2) + 2, (2 << 2 << 2) + (2 << 2) + True]])
)```
:white_check_mark: Your 3.13 eval job has completed with return code 0.
print("hello world")
huh
!e
eval(
''.join([bytes([_____]).decode() for _____ in [100 + ((2 << 2 << True) - (2 << True)), 100 + ((2 << 2 << True) - 2), 100 + (2 << True) + True, 100 + ((2 << 2 << True) - (2 << 2)) + 2, 100 + (2 << 2 << True), (2 << 2) + (2 << 2 << 2), (2 << 2 << 2) + 2, 100 + (2 << True), 100 + True, 100 + (2 << 2), 100 + (2 << 2), 100 + (2 << 2) + 2 + True, 2 << 2 << 2, 100 + (2 << 2 << True) + (2 + True), 100 + (2 & 2 & 2 ^ True | 2) + (2 | True | 0 + 2) + (2 | True) + 2, 100 + (2 << 2 << True) - (2 + 2 << True) + (2 << 2) - 2, 100 + (2 << 2), 100, (2 << 2 << 2) + 2, (2 << 2 << 2) + (2 << 2) + True]])
)```
:white_check_mark: Your 3.13 eval job has completed with return code 0.
hello world
!e ```py
HelloᅠWorld = lambda x: getattr(builtins,dir(builtins)[~-sum(b'HELLO, WORLD!'[:1<<1])])([*globals().items()][-2][0].replace('\uffa0',", "),end='!\n')
print = HelloᅠWorld
HelloᅠWorld(print)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
HelloᅠWorld!
oh..
!e
(
_ := __builtins__.__dir__().__len__().__floordiv__(__name__.__dir__().__len__()),
__builtins__.__getattribute__(
__builtins__.__dir__().__getitem__(
__builtins__.__dir__()
.__len__()
.__floordiv__(_.__add__(_.__add__(_.__add__(_))))
.__add__(_)
.__add__(_)
.__add__(_)
)
)(
__builtins__.__getattribute__(
__builtins__.__dir__().__getitem__(
__loader__.__dir__().__len__().__add__(__import__.__dir__().__len__())
)
)().join(
__builtins__.__getattribute__(
__builtins__.__dir__().__getitem__(
__loader__.__dir__()
.__len__()
.__add__(__doc__.__dir__().__len__())
.__sub__(
__name__.__dir__()
.__len__()
.__floordiv__(__import__.__dir__().__len__())
)
)
)(
__builtins__.__getattribute__(
__builtins__.__dir__().__getitem__(
__builtins__.__getattribute__(
__builtins__.__dir__().__getitem__(
_.__sub__(
__name__.__dir__()
.__len__()
.__floordiv__(__import__.__dir__().__len__())
)
)
)
.__dir__()
.__len__()
.__rshift__(_)
.__sub__(_)
)
),
(
(
__ := __doc__.__dir__().__len__().__lshift__(_.__add__(_))
).__add__(_.__lshift__(_.__add__(_))),
__.__add__(_),
__.__add__(_.__lshift__(_.__add__(_).__add__(_)))
.__add__(_)
.__add__(_),
__.__add__(_.__lshift__(_.__add__(_).__add__(_))),
__.__add__(
__import__.__dir__()
.__len__()
.__rshift__(_)
.__sub__(_.__lshift__(_.__add__(_)))
),
_.__lshift__(_.__lshift__(_.__add__(_)).__add__(_)),
__.__rshift__(_).__add__(_.__lshift__(_.__add__(_).__add__(_))),
__.__rshift__(_).__add__(_),
),
)
)
),
)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
henlo :3
interesting
the top level expression is a tuple
a walrus assignment then a call to __builtins__.__getattribute__ ?
what the actual fuck is this
yup
yeah you could definitely replace all the __builtins__.__dir__().__len__()s
some code someone posted in main
I was figuring out the structure of it
damn
Hehehehe
You did a good job deobfuscating it, but it's not really how it is supposed to work
!e
code
how is it supposed to work?
In simplest words, it is just print("hello world") but as an integer, all those bit shifting are there for confusion
aren't those for getting the character values
The whole program is just print("hello world")
Wait let me see, I don't remember honestly because I wrote it months ago
Oh no, you're right. My bad
like I assume it ends to being eval(''.join(["p", "r", "i", "n", "t",...]))
I mixed it with my another obfuscated program
Yeah that's it
this is in fact invalid python 3.12 syntax
it's a lot to dissect
i need a better library to work with asts than ast
ast sucks
close enough but yeah
okay no
not close enough
its more like
eval("print")
You can try a third party package
!pypi astor
@rapid sparrow hows it going
Nice byte by byte integer mapping
hey it's going good hbu?
oh I'll try this
that was my attempt to deobfuscate what it was doing lol
interesting, that's from astor.dump_tree
remind me a little bit of what llvm gives you when you dump a syntax tree
at school
wouldn’t be much helpful tbf, the best way is isolate out each value from the list and just do literal_eval
hmm, might be slightly different, but still
Oh true didn't really think about literal eval
Nano Banana is cool
What does this have to do with esoteric python?
Idk lol 
Maybe ai picture and ai is algorithms
But actually it looks cool
Well, it's not on-topic for #esoteric-python, which you would realize if you'd read the topic.
reporting in
!e
def co_print(function):
code = function.__code__
attr = [*filter(lambda x: x.startswith('co'), code.__dir__())]
attr.remove('co_lnotab')
for name in attr:
if name in ('co_lines', 'co_positions'):
print(name, [*getattr(code, name)()])
continue
print(name, getattr(code, name))
def func(a: float = 4, b: int = 5):
return a + b
co_print(func)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | co_lines [(0, 2, 14), (2, 10, 15)]
002 | co_positions [(14, 14, 0, 0), (15, 15, 11, 12), (15, 15, 11, 16), (15, 15, 11, 16), (15, 15, 4, 16)]
003 | co_argcount 2
004 | co_posonlyargcount 0
005 | co_kwonlyargcount 0
006 | co_stacksize 2
007 | co_flags 3
008 | co_nlocals 2
009 | co_consts (None,)
010 | co_names ()
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/CJW7DFZZKDKJCGGISA33RM6TMY
nice
!e
def co_print(function):
code = function.__code__
attr = [*filter(lambda x: x.startswith('co'), code.__dir__())]
attr.remove('co_lnotab')
for name in attr:
if name in ('co_lines', 'co_positions'):
print(name, [*getattr(code, name)()])
continue
print(name, getattr(code, name))
def func(a: float = 4, b: int = 5):
return a + b
co_print(co_print)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | co_lines [(0, 2, 1), (2, 26, 2), (26, 84, 4), (84, 118, 6), (118, 128, 8), (128, 140, 9), (140, 196, 10), (196, 200, 11), (200, 246, 12), (246, 252, 8)]
002 | co_positions [(1, 1, 0, 0), (2, 2, 11, 19), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 11, 28), (2, 2, 4, 8), (4, 4, 11, 66), (4, 4, 13, 19), (4, 4, 13, 19), (4, 4, 13, 19), (4, 4, 13, 19), (4, 4, 13, 19), (4, 4, 20, 48), (4, 4, 20, 48), (4, 4, 50, 54), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 62), (4, 4, 50, 64), (4, 4, 50, 64), (4, 4, 50, 64), (4, 4, 50, 64), (4, 4, 13, 65), (4, 4, 13, 65), (4, 4, 13, 65), (4, 4, 13, 65), (4, 4, 11, 66), (4, 4, 4, 8), (6, 6, 4, 8), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6, 4, 15), (6, 6,
... (truncated - too long, too many lines)
Full output: https://paste.pythondiscord.com/NVIVJXEAYL2QK6UPPC6NZGPYTY
now if u grab all those values and shove into a code object, u get that function but in that weird format i showed u
print(
type.mro(type)[1].__subclasses__()[36](
type.mro(type)[1].__subclasses__()[12](
1, 0, 0, 1, 1, 3, b'\x95\x00\x67\x01',
(None, 50), (), ('_',), __file__, '<>', '<>',
-1, b'', b'', (), ()
), {}
)(1)
)
fun isnt it
what's subclass 36 and 12
ahh
and thats one of many reasons this code only works in 3.13
code object changes surprisingly often 
that's cool
damn
i know the bytecode does
but I guess code object too
which fyi is what this b'\x95\x00\x67\x01' is
literally bytecode
how many instructions are there
in that string ?
yeah
anywhere btw 2 and 4
interesting
!e
b = 5
import dis
def co_print(function):
code = function.__code__
attr = [*filter(lambda x: x.startswith('co'), code.__dir__())]
attr.remove('co_lnotab')
for name in attr:
if name in ('co_lines', 'co_positions'):
print(name, [*getattr(code, name)()])
continue
print(name, getattr(code, name))
def test(_ : int = 1, __ : str = 2) -> bool:
global b
a = 5
return _
co_print(test)
dis.dis(test)
i = dis.get_instructions(test)
b = dis.Bytecode(test)
class obj:
def __init__(self, a : dis.Instruction):
self.name = a.opname
self.code = a.opcode
def __repr__(self):
code = hex(self.code)
return f"{self.name} {code}"
print(*[obj(_) for _ in [*i]], sep = '\n')
print(chr(0x24))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | co_lines [(0, 2, 17), (2, 6, 19), (6, 10, 20)]
002 | co_positions [(17, 17, 0, 0), (19, 19, 8, 9), (19, 19, 4, 5), (20, 20, 11, 12), (20, 20, 4, 12)]
003 | co_argcount 2
004 | co_posonlyargcount 0
005 | co_kwonlyargcount 0
006 | co_stacksize 1
007 | co_flags 3
008 | co_nlocals 3
009 | co_consts (None, 5)
010 | co_names ()
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/TP7IJXGPUOKNXSC542YX3DQSQI
u can tell i spent a few hours doing this when i got this many helper functions/classes
cant u
u should see the file
nice little helper functions
literally scribles of a madman
well you win the investigation award
also this one of the projects where i see this very annoying "feature" of python
b'\x95\x00S\x01n\x02U\x00$\x00'
if u look at the output
u gonna see this byte string
tell me, what byte is S or $
or n or U
idk
:white_check_mark: Your 3.13 eval job has completed with return code 0.
0x55
!e
print(b'\x55')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
b'U'
instead of printing x55 as the byte
oh
i think you can get it to print as hex if you make it an integer first
I'm not exactly sure how
but i know it can be done
b'\x8a}'
this was byte string of other project i was doing
and i went mad trying to figure out why was there a } in my bytes
prob some decode or encode thing
either way its stupid that it converts like that as default behavior
yeah
!e
print(rb'\x55')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
b'\\x55'
althought u can do this if u really want
but if the byte string is proceduraly generated
how the hell u convert it into raw string
!e
x = b"hello"
for b in x:
print(hex(b))```
i deserve it when in the other project i spent liek 3 days figuring out why C code (original) version was doing X with file but python translated (by me) version was doing Y
it was such a stupid reason
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 0x68
002 | 0x65
003 | 0x6c
004 | 0x6c
005 | 0x6f
!e
print(b'\x68\x65\x6c\x6c\x6f')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
b'hello'
oof
wanna know reason ?
why
C code wasnt reading the last byte of file cause of how fget (?) does things
python was
wtf
it was so stupid
how stupid
combine that and the byte string with {
that project tested my sanity
which i think has dried up at this point
yeah fr
wanna know what project it was
sorry to be a nuisance yall but does anyone know where to find help on python apis?
u prob gonna laugh
what one
#❓|how-to-get-help , imo import fastapi
a .sav reader for pokemon firered LMFAO
depends what API probably
oh if you mean that kind yeah
oh gosh
i actually have seen that repo
is quite something
emerald is my favorite pokemon
yeah
it's amazing that they got all that code together
and it compiles a perfect pokemon emerald
def update_checksum(self):
def calc_checksum(data, size):
checksum = 0
for i in range(size//4):
checksum += int.from_bytes(data[:4], 'little')
data = data[4:]
checksum &= 0xFFFFFFFF
return int.to_bytes(((checksum >> 16) + checksum) & 0xFFFF, 2, 'little')
size = self.data_type.SIZE
data = self.data[:size-1]
self.checksum = calc_checksum(data + b'\x00', size)
just the sanest among sanest python codes
btw i'm trying to learn how to use spotify api but i lowk don't know shit about apis in the first place
see that :size-1 and + 0 byte at bottom
thats the fix to behavior i said earlier
so goddamn stupid
did you ask in main and nobody there to help?
he didnt talk in #python-discussion no
u should learn about REST api and then go from there
!pypi spotipy
that's also a thing apparently @cunning lava
oh
okay i'll look into it
isnt it stupid that i had to do that to mimic C behavior
something somethign EOF
anyways
that stupid project that made me go mad aside
do u know about pascal triangle in math
maybe that's why things always warn if you don't end with an empty line
heard of it but no
maybe
the 1, 2 2 thing?
or whatever it is
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
yeah that
so since u know about it
this code should make u laugh a bit
!e
type("bruh", (), {"x": [1], "__call__": lambda self: [print(*self.x), setattr(self, "x", list(map(sum, zip([0] + self.x, self.x + [0])))), self][-1]})()()()()()()()()()()()()()()()()
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 1
002 | 1 1
003 | 1 2 1
004 | 1 3 3 1
005 | 1 4 6 4 1
006 | 1 5 10 10 5 1
007 | 1 6 15 20 15 6 1
008 | 1 7 21 35 35 21 7 1
009 | 1 8 28 56 70 56 28 8 1
010 | 1 9 36 84 126 126 84 36 9 1
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/SO3NPFKGHK3T5AN3X5VILYV63Q
that's funny
wanna know whats funnier ?
its configurable
u can adjust how many lines u want printed by adjusting the number of calls at end
!e
type("bruh", (), {"x": [1], "__call__": lambda self: [print(*self.x), setattr(self, "x", list(map(sum, zip([0] + self.x, self.x + [0])))), self][-1]})()()()()
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 1
002 | 1 1
003 | 1 2 1
i wondered if that's what that was
I'll have to mess around with it
have u ever coded a spiral matrix like this btw
never seen that
looks like a game board
huh
hello im a newbie to python can anyone advice me a playlist from youtube to learn it?
Android added Windows 10 blur
its a very funny lil intermediate ish project
my advice is dont learn from a youtube playlist :)
also go to #python-discussion , this place is uh
def not newbie friendly
the codes posted here are damn near war crimes
how are ppl coming here for general questions
they follow me clearly
lol
why not?
welp u see the pattern right
the lil spiral of numbers
ask #python-discussion tho
it's a better channel to ask in
and there's some smart ppl online rn
lol
good
anyways that guy aside
u see how the spiral matrix pattern is right
yes
idk why ppl always do that
more peculiar approach
print(*[globals().update({"size": int(input("Size of matrix ? ")), "g": lambda k, v: globals().update({k: v})}),g("options", [-size, 1]), g("instructions", sorted([1,size] * (size - 1)) + [-1] * (size - 1) + sum([sum(x[:-1], []) for x in list([[options[i]] * mult for i in range(2)] + [globals().update({"options": [-x for x in options]})] for mult in range(size - 2, 0, -1))] + [[0]], [])),g("Spiral", list(map(lambda _: sum(_), [[x[y] for x in [[n + 1 if m == l else 0 for m in range(size**2)] for n, l in enumerate([sum(instructions[:x1]) for x1 in range(size**2)])]] for y in range(size**2)]))),["\n" + f"{Spiral[x3]}".zfill(len(f"{size**2}")) if x3 % size == 0 else f"{Spiral[x3]}".zfill(len(f"{size**2}")) for x3 in range(size**2)]][-1])
did u see my tic tac toe, the board was a damn string

# Turn 1
@lambda _: [_[0], print(_[0]), _[-1]]
@lambda _: [_[0], print(" %s | %s | %s\n───+───+──\n %s | %s | %s\n───+───+──\n %s | %s | %s" % (*_[0],)), _[-1]]
@lambda _: [_[0][:_[1]-1] + "xo"[_[-1]] + _[0][_[1]:], (_[-1] + 1) % 2]
@lambda _: [" ", int(input("Which cell ? (1-9): ")), 0]
is *[ legal
ye its list unpacking ? 
anyways bot cant run this code
cause of input
!e print(*[])
:warning: Your 3.13 eval job has completed with return code 0.
[No output]
globals().update is good
no its awful
i could have just used walrus
i forgot walrus existed and its my only complaint of that 1 liner
lmfao
took me 3 damn days to make it
i did but got bored so halfway throught i just said "im onelining this anyways so fuck it im do it now"
i end up doing this because i try to write all the code in one line in the repl
so i can easily edit it
fun fact that one line is O(n^4) time complexity, its absolutely god awful
nobody understands
u on windows or linux

Linux usually
u should use python -i
i know of it
sick dont need to explain
but don't use that often
win win
i want readline to fix itself so it can complete expressions that have calls and indexing
powershell can do it
maybe it's because it's not statically typed
did u run this locally btw
no
!e
print(*[globals().update({"size": 7, "g": lambda k, v: globals().update({k: v})}),g("options", [-size, 1]), g("instructions", sorted([1,size] * (size - 1)) + [-1] * (size - 1) + sum([sum(x[:-1], []) for x in list([[options[i]] * mult for i in range(2)] + [globals().update({"options": [-x for x in options]})] for mult in range(size - 2, 0, -1))] + [[0]], [])),g("Spiral", list(map(lambda _: sum(_), [[x[y] for x in [[n + 1 if m == l else 0 for m in range(size**2)] for n, l in enumerate([sum(instructions[:x1]) for x1 in range(size**2)])]] for y in range(size**2)]))),["\n" + f"{Spiral[x3]}".zfill(len(f"{size**2}")) if x3 % size == 0 else f"{Spiral[x3]}".zfill(len(f"{size**2}")) for x3 in range(size**2)]][-1])
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 |
002 | 01 02 03 04 05 06 07
003 | 24 25 26 27 28 29 08
004 | 23 40 41 42 43 30 09
005 | 22 39 48 49 44 31 10
006 | 21 38 47 46 45 32 11
007 | 20 37 36 35 34 33 12
008 | 19 18 17 16 15 14 13
guess im run it here
fancy isnt it
yes
thats zfill doing it
very nice one liner
i got another 1 liner here that prints H
wanna see it
k
!e print('H')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
H
cool isnt it

!e
code
Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.
just joking here is the real thing
what the hell
yes
i do love them
and they're the only way to make functions on a single line besides exec
which is horrible
did u forget the code i showed u a few hours ago
oh
well that's a bit different
the only way without manually cobbling together a code object from scratch
ye
want me to btw
its actually a very simple algorithm that i just applied to itself like 4 times
i thought writing a pyc to disk was lame
i really need to learn all the weird .py extensions like .pyi and .pyc
there's pyd and pyo
cant wait for the esoteric codes my brain would think of with them
at least
there's a constant in stdlib someplace with them
probably in importlib somewhere
!e
"""
test gets passed to lambda right above
which then returns "5"
which then is passed to lambda above it
which returns "5" + "5" aka "55"
then thats passed into int becoming 55
which gets passed into lambda above and that returns [55, "5"]
which gets passed into lambda above and that returns [55, int("5" + "0")] which is [55, int("50")] which is [55, 50]
which then gets passed into lambda above and that returns [chr(55), chr(50)] which is ["7", "2"] cause of ascii table
which then gets passed into "".join above and that returns "72"
which then gets passed into int above and that returns 72
which then gets passed into chr above and that returns "H"
"""
@print
@chr
@int
@"".join
@lambda _: map(chr, _)
@lambda _: [_[0], int(_[1] + "0")]
@lambda _: [_, "5"]
@int
@lambda _: "5" + _
@lambda _: "5"
def test():
pass
:white_check_mark: Your 3.13 eval job has completed with return code 0.
H
it was this algorithm if u curious
i gotta go find that

this doc comment sounds eerily like specflow
dont know what that is
that doc i wrote by hand
it's like OPTIMIZED_EXTENSION_SUFFIXES or something like that
but now u make me wonder
it's a testing thing
how well do those auto-doc things do to my eso codes
for people that can't code but they actually have to learn to code to use it because of leaky abstractions
testers at my work have to use it sometimes
then they end up having to write c# code anyway
but it's supposed to be some "natural language" code generating test case thing
"given i have blah blah
and the blah blah
then i will have blah"
but not only do they have to write c# anyway
C# is fun
they have to write regexes to match the natural language
and figure out specflows garbage
and special annotations
so it would've been better if it didn't exist at all
as some1 who coded mods in both
i agree
althought terraria source code is def a legal code
!e
print(*map(chr, [55, 50]))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
7 2
!e
print(chr(72))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
H
interesting
funny lil code/algorithm isnt it 
@tropic night so close, just gotta fix that bunch of empty list at bottom
Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.
you are close now
!e
(subs := lambda cls, indent=' ': print(f'{indent}{cls.__name__}') or [subs(subcls, f'{indent} ') for subcls in cls.__subclasses__()] and None)(BaseException)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | BaseException
002 | BaseExceptionGroup
003 | ExceptionGroup
004 | Exception
005 | ArithmeticError
006 | FloatingPointError
007 | OverflowError
008 | ZeroDivisionError
009 | AssertionError
010 | AttributeError
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/WAQ4IBVPDXU7MVAS5SSEL74UQ4
turns out i can just use the funny and None trick
!e
(subs := lambda cls, indent=' ', extra = '': print(f'{indent}{extra}{cls.__name__}') or [subs(subcls, f'{indent} ', ' L ' if not extra else extra) for subcls in cls.__subclasses__()] and None)(BaseException)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | BaseException
002 | L BaseExceptionGroup
003 | L ExceptionGroup
004 | L Exception
005 | L ArithmeticError
006 | L FloatingPointError
007 | L OverflowError
008 | L ZeroDivisionError
009 | L AssertionError
010 | L AttributeError
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/WDORNJFJGBJ2H43HVV4X6IIXXI
and this one adds the lil L 
yo
.
Yo
That code i replied to basically as close as i get to bottom to top code execution
which
!e
"""
test gets passed to lambda right above
which then returns "5"
which then is passed to lambda above it
which returns "5" + "5" aka "55"
then thats passed into int becoming 55
which gets passed into lambda above and that returns [55, "5"]
which gets passed into lambda above and that returns [55, int("5" + "0")] which is [55, int("50")] which is [55, 50]
which then gets passed into lambda above and that returns [chr(55), chr(50)] which is ["7", "2"] cause of ascii table
which then gets passed into "".join above and that returns "72"
which then gets passed into int above and that returns 72
which then gets passed into chr above and that returns "H"
"""
@print
@chr
@int
@"".join
@lambda _: map(chr, _)
@lambda _: [_[0], int(_[1] + "0")]
@lambda _: [_, "5"]
@int
@lambda _: "5" + _
@lambda _: "5"
def test():
pass
:white_check_mark: Your 3.13 eval job has completed with return code 0.
H
thats not the case
it first goes to print
does print(
then goes to chr
so now print(chr(...
in commands it could be bottom to top like in list comprehension i guess
but every command gets executed (or read) from top to bottom
(i think)
true
btw i think its eivl who showed me the example u did with the x=4
and explained to me what happened
but shamefully, i dont remember what he said exactly
we had a help thread about it like years ago i think
its very funny isnt it
yea, i'm trying to find this thread
class inside function and nonlocal, nice
been an interesting talk, maybe i'll read it again to refresh my memory
if u want, i'd like to teach u what he taught me
after i refresh my memory about it
f(g(x))
``` reads `f` first during parsing, but it has to evaluate the arguments fully to call it, so `g` is *called* first during actual execution
yea but the line is read first
u read python commands from top to bottom
join me in the thread lambda i need u
nice
Whats going on
$ xxd ~/b.py
00000000: 7072 696e 7428 276e 6f27 290d 7072 696e print('no').prin
00000010: 743d 280d 6c61 6d62 6461 2078 3a4e 6f6e t=(.lambda x:Non
00000020: 6529 0d70 7269 6e74 2827 726f 626c 6f78 e).print('roblox
00000030: 2729 0a ').
I just replaced some \n with \r
what did you place in the file?
python for whatever reason treats \r as a newline
literally just
print('no')
print=(
lambda x:None)
print('roblox')
```but replacing \n with \r
how do you replace
you can insert a literal carriage return in vim if you really want to, but I did something like
cat ~/a.py | tr '\n' '\r' | sed 's/\r$/\n/'
```where the last thing is just to fix the trailing newline of the file to still be a newline
\r returns the cursor to the start of the line, without going to a new line
!e
print((_:=(_:=lambda __:type([lambda:'',lambda:chr(__[False])][len(__)>False](),(),{chr(__.pop(False)):[lambda _:b'\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21',_][len(__)>False](__)}))([*b'\x48\x65\x6c\x6c\x6f\x57\x6f\x72\x6c\x64'])).H.e.l.l.o.W.o.r.l.d)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
b'Hello World!'
what the
recursive nested classes !
does it print every time you access a member
no only the very last
!e
print((_:=(_:=lambda __:type([lambda:'',lambda:chr(__[False])][len(__)>False](),(),{chr(__.pop(False)):[lambda _:b'\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21',_][len(__)>False](__)}))([*b'\x48\x65\x6c\x6c\x6f\x57\x6f\x72\x6c\x64'])).H.e.l.l.o.W.o.r.l)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
<class '__main__.d'>
as u can see
lol where do you make the class
which
i make literally like 11 classes
in that code
@rapid sparrow do u understand how this is doing its thing 
print([i for i in range(10) if i % 2 == 0][::-1][::2])```
!e print([i for i in range(10) if i % 2 == 0][::-1][::2])
:white_check_mark: Your 3.13 eval job has completed with return code 0.
[8, 4, 0]
!e print(sum([ord(c) for c in 'lemon'] * 2))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
1078
(: Try to understand it
!e ```py
print([*range(10)[-2::-4]])
print(sum(b'lemon')*2)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | [8, 4, 0]
002 | 1078
is there a neat formula for double slices, i.e. converting from arr[a:b:c][d:e:f] to a single arr[x:y:z]? I'd be pretty interested since i always did trial and error (or ai) for that
arr[a+d*c : a+(e-d)*c : f*c] works for arr[a::c][d:e:f] and positive variables, surprisingly the b adds a lot of complexity in the general case
u want arr[a:b:c][d:e:f] == arr[x:y:z] ?
there's cases where it's optimizable into a single slice, but there are also others (like out-of-bound slices) where it's not
yeah, this
x, y, z = solve(a, b, c, d, e, f)
well technically since out of bounds slices just yield an empty list it's possible to represent as the result of a slicing operation
it just means putting cases in your code
!e ```def x2():
pass
x2.code = x2.code.replace(co_nlocals = 1, co_varnames = ('c', ), co_code=b'\x95\x00[\x01\x00\x00\x00\x00\x00\x00\x00\x00S\x01R\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00S\x02\x13\x00V\x00s\x02/\x00s\x02\x13\x00H\x1a\x00\x00n\x00[\x05\x00\x00\x00\x00\x00\x00\x00\x00[\x07\x00\x00\x00\x00\x00\x00\x00\x00U\x005\x01\x00\x00\x00\x00\x00\x00S\x03-\x0c\x00\x005\x01\x00\x00\x00\x00\x00\x00P\x02M\x1c\x00\x00\x0b\x00 \x00s\x02n\x005\x01\x00\x00\x00\x00\x00\x005\x01\x00\x00\x00\x00\x00\x00 \x00g\x00s\x02 \x00s\x02n\x00f\x00', co_consts=(None, '', '\x13\x1e\x17\x17\x14[\x0c\x14\t\x17\x1f', 123), co_names=('print', 'join', 'chr', 'ord'))
x2()```
:white_check_mark: Your 3.13 eval job has completed with return code 0.
hello world
Nice code 
!e py import dis x2 = lambda:... x2.__code__ = x2.__code__.replace(co_nlocals = 1, co_varnames = ('c', ), co_code=b'\x95\x00[\x01\x00\x00\x00\x00\x00\x00\x00\x00S\x01R\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00S\x02\x13\x00V\x00s\x02/\x00s\x02\x13\x00H\x1a\x00\x00n\x00[\x05\x00\x00\x00\x00\x00\x00\x00\x00[\x07\x00\x00\x00\x00\x00\x00\x00\x00U\x005\x01\x00\x00\x00\x00\x00\x00S\x03-\x0c\x00\x005\x01\x00\x00\x00\x00\x00\x00P\x02M\x1c\x00\x00\x0b\x00 \x00s\x02n\x005\x01\x00\x00\x00\x00\x00\x005\x01\x00\x00\x00\x00\x00\x00 \x00g\x00s\x02 \x00s\x02n\x00f\x00', co_consts=(None, '', '\x13\x1e\x17\x17\x14[\x0c\x14\t\x17\x1f', 123), co_names=('print', 'join', 'chr', 'ord')) dis.dis(x2)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 2 RESUME 0
002 | LOAD_GLOBAL 1 (print + NULL)
003 | LOAD_CONST 1 ('')
004 | LOAD_ATTR 3 (join + NULL|self)
005 | LOAD_CONST 2 ('\x13\x1e\x17\x17\x14[\x0c\x14\t\x17\x1f')
006 | GET_ITER
007 | LOAD_FAST_AND_CLEAR 0 (c)
008 | SWAP 2
009 | BUILD_LIST 0
010 | SWAP 2
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/3OHP3Z433Y7XFQ7QRDB3VQQMME
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | import pygame
004 | [1;35mModuleNotFoundError[0m: [35mNo module named 'pygame'[0m
:x: Your 3.13 eval job has completed with return code 1.
001 | File [35m"/home/main.py"[0m, line [35m1[0m
002 | pip [1;31minstall[0m pygame
003 | [1;31m^^^^^^^[0m
004 | [1;35mSyntaxError[0m: [35minvalid syntax[0m
What's the meaning of esoteric?
For example
The channel description sums it up pretty well
Now I'll need a description of that
It's safe to assume there's a lot of research for me to do on this language
Thanks for the heads up!
It's not really language specific fyi
These concepts exist in most (all?) languages
to be fair, "everything is an object" and accessing all possible attributes is something I've only came across in python and javascript
sure you can refer to functions and methods as objects in java too but there's not really much to dig into there
you'll find it goes pretty deep once you deal with class loaders and reflection more generally
Basically to sum it up, basically make code intentionally unreasonable in a fun way while still working perfectly, to amaze people in this channel or annoying people outside the channel, and learn weird quirk of the language at the same time
!e does this still run in python? backwards compatibility gives me a headache sometimes
import ctypes
p = ctypes.py_object.from_address(id(...)+8)
class BreakPython:
value = [*'Heo World!']
def __neg__(self):
self.value.insert(2,'l')
return self
def __sub__(self, also_self):
print(''.join(self.value))
p.value = BreakPython
...---...
p.value = object
:white_check_mark: Your 3.13 eval job has completed with return code 0.
Hello World!
we're up to 3.13 now? I missed 3.12 it seems. I've been using 3.9 this whole time
!e what about the mutable string setup I made in 2022? ```py
from ctypes import*;
class output:
def init(self,victim):self.victim=id(victim);ol=len(victim);(c_charol).from_address(id(victim)+48)[:]=[0]ol;c_longlong.from_address(id(victim)+16).value=0;
def lt(self,item):_l=c_longlong.from_address(self.victim+16);_l.value+=1;_a=c_byte.from_address(self.victim+48+_l.value);_a.value=-item;return 0;
neg=lambda s:s;
def gt(self,a):a,i,_l=a,c_longlong.from_address(self.victim+16);data=(c_byte_l.value).from_address(self.victim+49);v,data[:-1]=data;l.value-=1;a[i]=v;return 0;
class array:
def init(self,victim):self.memory="\0\0\0\0\0\0\0\0"[:]*256;=self.memory=id(self.memory);c_longlong.from_address(+16).value=2568-1;self.i=0;self.o=output(victim)
@property
def mem(self):return(c_byte(2568-1)).from_address(self.memory+48);
def inc(self):self.mem[self.i]+=1;return 0;
def dec(self):self.mem[self.i]-=1;return 0;
def left(self):self.i-=1;return 0;
def rite(self):self.i+=1;return 0;
def dot(self):return self.o <- self.mem[self.i];
def com(self):return(self.mem,self.i) <- self.o;
def loop(self):return+(not self.mem[self.i]);
def endl(self):return-bool(self.mem[self.i]);
def iter(self):return iter([self.mem]);
def _get(self,c,p):
if not 0<=p<len(c):raise StopIteration;
return c[p];
def run(self,c):
p=t=0;s=type('',(),{'iter':lambda s:s,'next':lambda s:self._get(c,p)})();
try:
for k in s:t=t+(k=='[')-(k==']')if t else{'+':self.inc,'-':self.dec,'<':self.left,'>':self.rite,'.':self.dot,',':self.com,'[':self.loop,']':self.endl}.get(k,lambda:0)();p+=1-2*(t<0);
except:0;
finally:return self.o;
def brainfuck(victim,,_n=[0]):clone,a=victim+'.',array(victim);a.run(clone);_l=c_longlong.from_address(a.o.victim+16);l=_l.value;_l.value-=1;data=(c_bytel).from_address(a.o.victim+48);_,*data[:-1]=data;import('sys')._getframe(1).f_globals[_n[0]]=a.o;_n[0]+=1;return 0;
...;
code="++++++++++[>+++++++>+++++++++++>+++<<<-]++++++++++>++>--.>++.<.<.>-------.,..+++.>++++++++++++.,.+<<+++++++++++++++.>.+++.,.--------.>.<<<.";
print(code);
brainfuck(code);
print(code);
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | ++++++++++[>+++++++>+++++++++++>+++<<<-]++++++++++>++>--.>++.<.<.>-------.,..+++.>++++++++++++.,.+<<+++++++++++++++.>.+++.,.--------.>.<<<.
002 | ++++++++Hello,
nope it's broken
noooooo my backwards compatibility
something has moved by 8 bytes and I don't know what it is
it works fine in 3.9
!e alright fixed it. I replaced all the 48 with 40 and the 49 with 41. It seems the lists are smaller in memory now. ```py
from ctypes import*;
class output:
def init(self,victim):self.victim=id(victim);ol=len(victim);(c_charol).from_address(id(victim)+40)[:]=[0]ol;c_longlong.from_address(id(victim)+16).value=0;
def lt(self,item):_l=c_longlong.from_address(self.victim+16);_l.value+=1;_a=c_byte.from_address(self.victim+40+_l.value);_a.value=-item;return 0;
neg=lambda s:s;
def gt(self,a):a,i,_l=a,c_longlong.from_address(self.victim+16);data=(c_byte_l.value).from_address(self.victim+41);v,data[:-1]=data;l.value-=1;a[i]=v;return 0;
class array:
def init(self,victim):self.memory="\0\0\0\0\0\0\0\0"[:]*256;=self.memory=id(self.memory);c_longlong.from_address(+16).value=2568-1;self.i=0;self.o=output(victim)
@property
def mem(self):return(c_byte(2568-1)).from_address(self.memory+40);
def inc(self):self.mem[self.i]+=1;return 0;
def dec(self):self.mem[self.i]-=1;return 0;
def left(self):self.i-=1;return 0;
def rite(self):self.i+=1;return 0;
def dot(self):return self.o <- self.mem[self.i];
def com(self):return(self.mem,self.i) <- self.o;
def loop(self):return+(not self.mem[self.i]);
def endl(self):return-bool(self.mem[self.i]);
def iter(self):return iter([self.mem]);
def _get(self,c,p):
if not 0<=p<len(c):raise StopIteration;
return c[p];
def run(self,c):
p=t=0;s=type('',(),{'iter':lambda s:s,'next':lambda s:self._get(c,p)})();
try:
for k in s:t=t+(k=='[')-(k==']')if t else{'+':self.inc,'-':self.dec,'<':self.left,'>':self.rite,'.':self.dot,',':self.com,'[':self.loop,']':self.endl}.get(k,lambda:0)();p+=1-2*(t<0);
except:0;
finally:return self.o;
def brainfuck(victim,,_n=[0]):clone,a=victim+'.',array(victim);a.run(clone);_l=c_longlong.from_address(a.o.victim+16);l=_l.value;_l.value-=1;data=(c_bytel).from_address(a.o.victim+40);_,*data[:-1]=data;import('sys')._getframe(1).f_globals[_n[0]]=a.o;_n[0]+=1;return 0;
...;
code="++++++++++[>+++++++>+++++++++++>+++<<<-]++++++++++>++>--.>++.<.<.>-------.,..+++.>++++++++++++.,.+<<+++++++++++++++.>.+++.,.--------.>.<<<.";
print(code);
brainfuck(code);
print(code);
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | ++++++++++[>+++++++>+++++++++++>+++<<<-]++++++++++>++>--.>++.<.<.>-------.,..+++.>++++++++++++.,.+<<+++++++++++++++.>.+++.,.--------.>.<<<.
002 | Hello, World!
the funny thing is the default value of _n in the function definition gets mutated each time brainfuck runs, so the global namespace gets filled with an archive using numbers as names.
_n doesn't get initialised as [0] every time it runs, only when the definition is created.
This feels... not beginner friendly.
Well I've worked more on python than other languages as of now so that was my perspective that I need to work on this more, the concepts are mostly agnostic so no problem there
oh goodness!
its been a long time since you've been around here
wow thats fucking with my brain (iykwim)
code
!e print hello
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m2[0m, in [35m<module>[0m
003 | from keyboard import is_pressed as مضغوط
004 | [1;35mModuleNotFoundError[0m: [35mNo module named 'keyboard'[0m
!e
Click here to see this code in our pastebin.
arabic python
the very legal syntax
Back before annotations behaviour got changed I could bootstrap python to do
int: 5 = a
Can you not still do that, even post 3.14?
bad_and = lambda a,b:~-(a<<1+~-b)>0
wrote boolean and in a dumb way because i felt like it
breaks if the inputs arent bools / 0 / 1, obviously
turns out the expression (sans lambda) works in C# and C as well
good_bool = lambda b: not not b```
I'm too lazy to figure out how new annotations works.
@shrewd ore
victim :keka:
Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.
do u like lambdas
holy fucking cow shit
absolutely not
what it outputs is absolutely astonishing as well
now i can say that this uses only 2 global variables but i can be wrong
lemme test
H
how do you even find out about this wtf
there is nothing to find about that particular code above
its just a funny algorithm i came up with one day then went wonky with it
!e
"""
test gets passed to lambda right above
which then returns "5"
which then is passed to lambda above it
which returns "5" + "5" aka "55"
then thats passed into int becoming 55
which gets passed into lambda above and that returns [55, "5"]
which gets passed into lambda above and that returns [55, int("5" + "0")] which is [55, int("50")] which is [55, 50]
which then gets passed into lambda above and that returns [chr(55), chr(50)] which is ["7", "2"] cause of ascii table
which then gets passed into "".join above and that returns "72"
which then gets passed into int above and that returns 72
which then gets passed into chr above and that returns "H"
"""
@print
@chr
@int
@"".join
@lambda _: map(chr, _)
@lambda _: [_[0], int(_[1] + "0")]
@lambda _: [_, "5"]
@int
@lambda _: "5" + _
@lambda _: "5"
def test():
pass
:white_check_mark: Your 3.13 eval job has completed with return code 0.
H
this explains the algorithm if u want to understand it
brainfuck
nah thats another completely different language
same idea
@spark gale
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 1, 1, 0,
1, 1, 1, 1, 1, 0, 0, 0, 1, 0,
]
print(*map(lambda _: f"<!%s!>" % (''.join(map(tiles.__getitem__, _)),),__import__('itertools').batched(grid, WIDTH)),sep='\n')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | <!. . . . . . . . . . !>
002 | <!. . . . . . . . . . !>
003 | <!. . . . . . . . . . !>
004 | <!. . . . . . . . . . !>
005 | <!. . . . . . . . . . !>
006 | <!. . . . . . . . . . !>
007 | <!. . . . . . . . . . !>
008 | <!. . . . . []. . . . !>
009 | <!. . . . . []. . . . !>
010 | <!. . . . . []. . . . !>
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/QEQ63EQI3SSDFQ6JNSGEB7DB7I
nah, that's cheating to use itertools for this 😉
but batched() definitely is the right tool for the job, it just makes this almost too easy, especially if you just import it at the top of the code as you normally would
nah i thought it was cheaty too
just thought i could get by easy
guess not
recursive lambda time
lets reinvent batched
you don't really need the f-string there, your not using it
adds flavour
in that case add an r in-front of it too to add more flavor, reminds me of rm -rf then 😁
also u
might as well add b
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]
print((b:=lambda i: [
[
lambda: [grid[i:i+WIDTH],],
lambda: [grid[i:i+WIDTH], b(i+WIDTH)][0]
][i!=WIDTH]()
]
)(False))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
i mean
thats a first batch success ?
i wonder if thats last batch
and it went throught sucessfully
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]
print((b:=lambda i: [
[
lambda: [grid[i:i+WIDTH], print(i)][0],
lambda: [grid[i:i+WIDTH], b(i+WIDTH)][0]
][i!=WIDTH]()
]
)(False))
not really more compact then a comprehension anymore though
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 10
002 | [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
this was never about compact lets both be honest
haha
oh i see the error damnit
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]
print((b:=lambda i: [
[
lambda: [grid[i:i+WIDTH], ][0],
lambda: [grid[i:i+WIDTH], print(i), b(i+WIDTH)][0]
][i!=len(grid)]()
]
)(False))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | False
002 | 10
003 | 20
004 | [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
do u understand this code
cause it seems to be giving every batch one at a time but never all present at same time
yeah, all bow to the mighty walrus that saves our day
walrus is what makes this readable
u should see my spiral matrix 1 liner
i forgot walrus existed and did that one the hard way
!e
print(*[globals().update({"size": 7, "g": lambda k, v: globals().update({k: v})}),g("options", [-size, 1]), g("instructions", sorted([1,size] * (size - 1)) + [-1] * (size - 1) + sum([sum(x[:-1], []) for x in list([[options[i]] * mult for i in range(2)] + [globals().update({"options": [-x for x in options]})] for mult in range(size - 2, 0, -1))] + [[0]], [])),g("Spiral", list(map(lambda _: sum(_), [[x[y] for x in [[n + 1 if m == l else 0 for m in range(size**2)] for n, l in enumerate([sum(instructions[:x1]) for x1 in range(size**2)])]] for y in range(size**2)]))),["\n" + f"{Spiral[x3]}".zfill(len(f"{size**2}")) if x3 % size == 0 else f"{Spiral[x3]}".zfill(len(f"{size**2}")) for x3 in range(size**2)]][-1])
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 |
002 | 01 02 03 04 05 06 07
003 | 24 25 26 27 28 29 08
004 | 23 40 41 42 43 30 09
005 | 22 39 48 49 44 31 10
006 | 21 38 47 46 45 32 11
007 | 20 37 36 35 34 33 12
008 | 19 18 17 16 15 14 13
yeah, that one is kind of crazy
its even crazier when u realized its like O(n^4) in time AND space complexity
lots of comprehensions in there
lots of globals abuse cause walrus was forgotten
as well
that [0] really was issue huh
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]
print(
(
b := lambda i: [
*[
lambda: grid[i:i+WIDTH],
lambda: [*grid[i:i+WIDTH], *b(i+WIDTH)]
][i!=len(grid)]()
]
)(False)
)
so
it works
its just a lil scuffed with nesting
almost perfect
:white_check_mark: Your 3.13 eval job has completed with return code 0.
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0]
a lil too perfect
god damnit
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]
print(
(
b := lambda i: [
*[
lambda: grid[i:i+WIDTH],
lambda: [grid[i:i+WIDTH], *b(i+WIDTH)]
][i!=len(grid)]()
]
)(False)
)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
yeah, three we go
now to replace the batched in original with this
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 1, 1, 0,
1, 1, 1, 1, 1, 0, 0, 0, 1, 0,
]
print(*map(lambda _: f"<!%s!>" % (''.join(map(tiles.__getitem__, _)),),(
(
b := lambda i: [
*[
lambda: grid[i:i+WIDTH],
lambda: [grid[i:i+WIDTH], *b(i+WIDTH)]
][i!=len(grid)]()
]
)(False)
)),sep='\n')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | <!. . . . . . . . . . !>
002 | <!. . . . . . . . . . !>
003 | <!. . . . . . . . . . !>
004 | <!. . . . . . . . . . !>
005 | <!. . . . . . . . . . !>
006 | <!. . . . . . . . . . !>
007 | <!. . . . . . . . . . !>
008 | <!. . . . . []. . . . !>
009 | <!. . . . . []. . . . !>
010 | <!. . . . . []. . . . !>
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/H6YWHF6JIY2F7R65T4S4MDKN6Q
actually works huh
!e
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 1, 1, 0,
1, 1, 1, 1, 1, 0, 0, 0, 1, 0,
]
print(*map(lambda _: f"<!%s!>" % (''.join(map(tiles.__getitem__, _)),),((b:=lambda i: [*[lambda: grid[i:i+WIDTH],lambda: [grid[i:i+WIDTH], *b(i+WIDTH)]][i!=len(grid)]()])(False))),sep='\n')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | <!. . . . . . . . . . !>
002 | <!. . . . . . . . . . !>
003 | <!. . . . . . . . . . !>
004 | <!. . . . . . . . . . !>
005 | <!. . . . . . . . . . !>
006 | <!. . . . . . . . . . !>
007 | <!. . . . . . . . . . !>
008 | <!. . . . . []. . . . !>
009 | <!. . . . . []. . . . !>
010 | <!. . . . . []. . . . !>
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/N7MPE5GSL226VM7SOI67YTYFJI
and this version also works ig
yeah, if you can make it into one line you should 😉
do u understand how this recursive lambda bs works btw
its one of the funniest tricks i came up with during my esopy adventures
yeah i see it now, damn
ye else u dont get fuckery like )),),((
and it actually being legal syntax
since we here
!e
print((_:=(_:=lambda __:type([lambda:'',lambda:chr(__[False])][len(__)>False](),(),{chr(__.pop(False)):[lambda _:b'\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21',_][len(__)>False](__)}))([*b'\x48\x65\x6c\x6c\x6f\x57\x6f\x72\x6c\x64'])).H.e.l.l.o.W.o.r.l.d)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
b'Hello World!'
what u think of my latest hello world
hahaha, that's so contrived and i like it
i think you could stick an xor in there too and use for each of the bytes so that you don't have hello world spelled out anywhere in there
the first byte string being unpacked is HelloWorld
the other one is what bot prints
honestly when i found out about that "feature" of byte strings i nearly lost it
yeah, saw that
!e
print(b'\xA8\x7d')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
b'\xa8}'
like why
it's just your big calculation 984697963845**7438888888888886 taking a lot of time
!e
def ytrhkhdkhyhkrhykkjhjtkjhjkdhkjdkkhjhtkyjdhkjhydkjytkdt() -> int:
klghdkhglksgsgs = input("enter your name:")
lkdfhjshkjdfkgsdfg = float(input("Enter your hight in cetimeter:"))
khdkhhkslhjfdkhdg = float(input("Your weight in kilgorams"))
kjdslfkhjklhsdg = ((lkdfhjshkjdfkgsdfg % 30.48) / 30.48) * 12
khsklhkhkhkfhshglksflhskjgsgfdslgfslkhgfjfgd = lkdfhjshkjdfkgsdfg // 30.48
hklhdsfhlgkhlkfdlhjhgflkhhgkjfdslhdsg = khdkhhkslhjfdkhdg * 2.205
print(
f"{klghdkhglksgsgs} are {khsklhkhkhkfhshglksflhskjgsgfdslgfslkhgfjfgd} feet {round(kjdslfkhjklhsdg, 2)} inches and {hklhdsfhlgkhlkfdlhjhgflkhhgkjfdslhdsg} pounds"
)
return int(((984697963845**7438888888888886) / (5463465646 + 43)) * 0)
if __name__ == "__main__":
exit(ytrhkhdkhyhkrhykkjhjtkjhjkdhkjdkkhjhtkyjdhkjhydkjytkdt())
:x: Your 3.13 eval job has completed with return code 1.
001 | enter your name:Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m15[0m, in [35m<module>[0m
003 | exit([31mytrhkhdkhyhkrhykkjhjtkjhjkdhkjdkkhjhtkyjdhkjhydkjytkdt[0m[1;31m()[0m)
004 | [31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m[1;31m^^[0m
005 | File [35m"/home/main.py"[0m, line [35m2[0m, in [35mytrhkhdkhyhkrhykkjhjtkjhjkdhkjdkkhjhtkyjdhkjhydkjytkdt[0m
006 | klghdkhglksgsgs = input("enter your name:")
007 | [1;35mEOFError[0m: [35mEOF when reading a line[0m
:C
you can't use input with the bot to start with
oh ok
and the long file name and function name and variable names doesn't do much to obfuscate things much, just takes up space
i wonder how long it will take...
no idea 🤷
it's up to your hardware, but it might be such a big number that it won't complete in any reassemble time on any current general cpu
!e
Esoteric idea: instead of leaving scattered comments inline, do what books and papers do and have superscript annotations with an expansion at the bottom of the page or chapter.
@lambda __:__()
class _:
def __call__(self, *a, **kw): return self
def __rxor__(self, other): return other
def __neg__(self): return self
def complicated_function(i, like, bananas, phi):
line1 = phi + 0.3879*bananas**phi ^_(1)
line2 = i - bananas * (1.00053) + like ^_(2)
line1 += 0.01 ^_(2)
return line1, line2
-----------------------_
_[1]: "Meta-analysis: on the popularity of bananas" (Smith, Bananov & al (2019))
_[2]: "Thermal microadjustments in banana population" (Smith (2019))
:warning: Your 3.14 pre-release eval job has completed with return code 0.
[No output]
without the walrus ```py
WIDTH = 10
tiles = [". ", "[]", "[]"]
grid = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]
print((lambda i, f: [
[
lambda: [grid[i:i+WIDTH], ][0],
lambda: [grid[i:i+WIDTH], print(i), f(i+WIDTH, f)][0]
]i!=len(grid)
]
)(False, (lambda i, f: [
[
lambda: [grid[i:i+WIDTH], ][0],
lambda: [grid[i:i+WIDTH], print(i), f(i+WIDTH, f)][0]
]i!=len(grid)
]
)))
i mightve mixed uo the parens but its not really that much more complicated
wait how does it not do "str object is not callable" down there?
I'm guessing that's because it was run in 3.14 and in 3.14 annotations are no longer eagerly evaluated
oh that's cool
i remember in 3.9 code like this:
expr1
expr2
expr3``` can also be written in a single line, with annotated subscr, bytecode would be identical
The
[expr1, expr2, expr3]
Is probably the best.
yeah but that actually has build_list in the bytecode
I meant exact bytecodes
I'll try to come up with an example
!e 3.13 py import dis dis.dis('a;b;c') dis.dis('a[b]:c')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 0 RESUME 0
002 |
003 | 1 LOAD_NAME 0 (a)
004 | POP_TOP
005 | LOAD_NAME 1 (b)
006 | POP_TOP
007 | LOAD_NAME 2 (c)
008 | POP_TOP
009 | RETURN_CONST 0 (None)
010 | 0 RESUME 0
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/BHNC7DBHB4DOB2H7FECMKNFZFQ
there, the only difference is the SETUP_ANNOTATIONS at the beginning
!e 3.13 py p = print p("first")[p("second")]: p("third")
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | first
002 | second
003 | third
Hi guys just excuse me but how to make the code block with color formatting?
!cod
additionally for full color customization you can use ansi codes as well
!e py import dis dis.dis('a;b;c') dis.dis('a[b]:c')
:white_check_mark: Your 3.14 pre-release eval job has completed with return code 0.
001 | 0 RESUME 0
002 |
003 | 1 LOAD_NAME 0 (a)
004 | POP_TOP
005 | LOAD_NAME 1 (b)
006 | POP_TOP
007 | LOAD_NAME 2 (c)
008 | POP_TOP
009 | LOAD_CONST 0 (None)
010 | RETURN_VALUE
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/VFNRNIVA3Z725PU6NHTXYKCYGM
yeah this really is different in 3.14, c doesn't execute anymore
sounds like a neat hack to differentiate between the versions
version = 14
None[1]:(version:=version-1)```
i need some help for my python asignment that in need to submit today
it might be better to ask in #1035199133436354600 or #python-discussion (unless you have a very odd assignment)
!e
eval(f'{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
h
omg what
what's: c, character?
what does :c do in f'
is this an inplace subtract
i see, its print("h")
!e
print(ord('h'))
print(chr(0x72))
print(f'{114:c}')
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 104
002 | r
003 | r
!e print(---4)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
-4
oh
eval("print("h")") or something
along those lines ye
!e x = 4; print(---x)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
-4
not quite jsfuck level but fun enough i would say 
!e print(f"{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c,}")
yea not bad at all
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | print(f"[1;31m{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c,}[0m")
004 | [1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[0m
005 | [1;35mValueError[0m: [35mInvalid format specifier 'c,' for object of type 'int'[0m

,
in like 9 chars if u not counting eval()
yeah