#esoteric-python

1 messages · Page 54 of 1

magic wraith
#

i mean append

#

not add

shy sable
#

isinstance should probably be appended to the list as well.

quartz wave
#

map() too

balmy turtle
earnest wing
#

This is awesome

patent arrow
#

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 ?

quartz wave
earnest wing
#

i personally use lambdas with mutable defaults as the mutable default of a def

balmy turtle
gleaming linden
quartz wave
#

to = to if to is not None else []?

#

if only we had ?? then we could do to ??= []

balmy turtle
balmy turtle
restive void
#

Why can't we do to or= [] ducky_drawing

restive void
# balmy turtle

!e

def foo(a=None):
    a = a or []
    a.append(1)

x = []
foo(x)
print(x)
night quarryBOT
balmy turtle
#

ahh right I get what you mean

#

got a bit confused there my bad

keen oyster
#

what's good here?

balmy turtle
#

brah lmao

#

thankyou

grave grail
#

to=[to,[]][to is None]

magic wraith
night quarryBOT
rapid sparrow
#

has there been much progress on decomp?

rapid sparrow
odd marlin
#

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)```
shy sable
rapid sparrow
#

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

rapid sparrow
#

interestingly sometimes _Py_tss_tstate is null, but _Py_tss_gilstate is not

analog lichen
#

If I ever have to debug this again I'd rather rewrite everything from the ground up

rapid sparrow
#

I guess you could move those to an XXXStatics class or something, but it doesn't seem like a great solution

rapid sparrow
#

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

cerulean wadi
#

Don't Scan 😉

low pelican
cerulean wadi
#

Chill bro

low pelican
#

Ah shit it's just a qr code generator

restive void
#

Nothing malicious, carry on

low pelican
#

It's very sus to send a random QR code though lmao

restive void
low pelican
cerulean wadi
#

😂 I thought I was creative to post it like that

low pelican
#

Well it kinda was lul

cerulean wadi
analog lichen
grave grail
# cerulean wadi Don't Scan 😉

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

quartz wave
#

a

quartz wave
#

hmm

#

e

#

okay testing done

#

trying to do this with discord snowflakes is a bit hard-

vocal carbon
#

hlw every one

cerulean wadi
#
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()])
clear fossil
#

󠁛󠀣󠀰󠀵󠀸󠁦󠀱󠀰󠀬󠀣󠁣󠀷󠀰󠀹󠀰󠀹󠁝

stable hornet
night quarryBOT
oblique ibex
#

chr(80) is P but even if you do max(range(80)) that would be 79 (O)

fleet lintel
grave grail
somber elk
#

!e print(chr(sum(range(ord(min(str(not())))))))

night quarryBOT
cerulean wadi
restive void
#

!charinfo ඞ

night quarryBOT
cerulean wadi
rapid sparrow
rapid sparrow
#

kind of like a QR quine if QR codes could execute (calling it "QR code" is kinda funny)

rapid sparrow
#

another challenge idea

#

shortest code to crash from stack recursion?

#

!e here's my attempt

(a := (lambda: a()))()```
night quarryBOT
# rapid sparrow !e here's my attempt ```py (a := (lambda: a()))()```

:x: Your 3.13 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     (a := (lambda: a()))()
004 |     ~~~~~~~~~~~~~~~~~~~~^^
005 |   File "/home/main.py", line 1, in <lambda>
006 |     (a := (lambda: a()))()
007 |                    ~^^
008 |   File "/home/main.py", line 1, in <lambda>
009 |     (a := (lambda: a()))()
010 |                    ~^^
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/J63TJHOFOPHNHNYGKLDDZU2MVM

obtuse hazel
rapid sparrow
#

lol true I forgot about that

#

oh there's a pair of unneeded parens too

#

!e

(a:=lambda:a())()```
night quarryBOT
# rapid sparrow !e ```py (a:=lambda:a())()```

:x: Your 3.13 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     (a:=lambda:a())()
004 |     ~~~~~~~~~~~~~~~^^
005 |   File "/home/main.py", line 1, in <lambda>
006 |     (a:=lambda:a())()
007 |                ~^^
008 |   File "/home/main.py", line 1, in <lambda>
009 |     (a:=lambda:a())()
010 |                ~^^
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/FQT3R7WBUKHRFTI4WD4II7MQEM

rapid sparrow
#

oh no don't tell me the lambda is longer

obtuse hazel
#

!e

print(len("(a:=lambda:a())()"))
print(len("""def a():a()
a()"""))
night quarryBOT
obtuse hazel
#

yep

rapid sparrow
#

nooo

#

well we can stipulate it has to be one line

obtuse hazel
#

I don't think you can improve then

rapid sparrow
#

hmm yeah quite possibly lol

#

it is funny you figured out the most straightforward way was the shortest

split summit
#

!e

def a():a()
austere mauve
mental cairn
#

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...

versed eagle
#

[(arg,), (arg,), (kwkey, kwval), ...]

#

imagine zipping things

mental cairn
#

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.

subtle viper
#

i'm not getting this..

mental cairn
#

lol. I got it to work, though 😄

earnest wing
#

then to use the bound arguments you can call the original function with the resulting .args and .kwargs

rapid sparrow
#

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

wicked dagger
rapid sparrow
#

omg

rapid sparrow
night quarryBOT
# rapid sparrow !e ```py 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

unique heath
warm cape
#

uhh gives me a type error somewhere

wary python
warm cape
#

guess i'll have to make my own

rapid sparrow
cerulean wadi
#
import pywhatkit as kt

img_loc = input("Enter the image location: ")
kt.image_to_ascii_art(img_loc, "ascii_text.txt")

Image --> ASCII Art

wary python
austere mauve
#

!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)

night quarryBOT
austere mauve
#

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)

night quarryBOT
night quarryBOT
wary python
#

!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

night quarryBOT
wary python
#

!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__(_))))))```
night quarryBOT
wary python
#

henlo :3

left tartan
#

IOPCC when

wary python
wary python
#

they break after every update so it has to be rewritten every year

wary python
#

this one is one of the shorter ones but imo one of the more confusing ones

#

no magic numbers/strings

left tartan
wary python
primal idol
#

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

karmic pumice
night quarryBOT
#

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 */```
primal idol
#

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

primal idol
#

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()
night quarryBOT
primal idol
#

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)

bright valve
wary python
#

nothing but dunders

#

only dunder

bright valve
#

how do you manage to join dunders into an actual output

wary python
#

basically

#

you know __builtins__ right

bright valve
#

yeah

wary python
#

yeah

#

you know __builtins__.func = func if the func is a builtin right

bright valve
#

yeah

wary python
#

thats basically it

bright valve
#

ok bro

wary python
# bright valve 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

bright valve
#

ok let me try

rich lagoon
#

I just feel like dropping this in here ```py
j=lambda m,d,l=0:275m//9-30+d-(2-int(l))(m>2)

rich lagoon
#

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$$

flint hollow
#

.latex $$J = \frac{275 * M}{9} - 30 + D + X$$

glass drumBOT
flint hollow
#

honestly not sure why that's not enabled here

rich lagoon
#

X is 0 for first 2 months
After february, X is -1 for leap years and -2 otherwise

rich lagoon
#

anything else will break the code

subtle viper
#

it can be a string?

rich lagoon
#

no

subtle viper
#

i see

rich lagoon
#

l is for "is this a leap year"

#

if true and m>2 then add 1

rich lagoon
cyan kraken
#

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]])
subtle viper
#

oh. i see

subtle viper
#

3.12+, on the other hand, inlines listcomps and therefore allows accessing g as a local variable in the enclosing lambda scope

subtle viper
cyan kraken
#

why is it inconsistent in 3.11 rather than consistently NameError?

subtle viper
#

it should be consistent, but i'm gonna test..

subtle viper
#

when that inner loop either

  1. doesn't exist
  2. doesn't use g
    then exec() can't resolve g in the local scope and treats it as a global, thus the NameError
cyan kraken
subtle viper
haughty pelican
#

I see the pattern now, thanks

subtle viper
hidden patrol
gusty cloud
#

Hi

austere mauve
#

New challenge:
Did you know that you can get compile-time recursion error?
My PB: ||5985bytes||

rapid sparrow
#

you mean when it's creating the bytecode?

#

I wish to experience said compile-time error

grave grail
#

!e

exec("+".join("1" for _ in range(1002)))
night quarryBOT
grave grail
#

Hmm

#

When does this not broke

#

!e

exec("+".join("1" for _ in range(2994)))
night quarryBOT
grave grail
#

??? On mine it just error

#

!e

exec("+".join("1" for _ in range(29940)))
night quarryBOT
# grave grail !e ```py exec("+".join("1" for _ in range(29940))) ```

:x: Your 3.13 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     exec("+".join("1" for _ in range(29940)))
004 |     ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | RecursionError: maximum recursion depth exceeded during compilation
grave grail
#

Ok,so it might be different per platform? Great

subtle viper
#

!e exec("+"*5969+"1")

night quarryBOT
# subtle viper !e exec("+"*5969+"1")

:x: Your 3.13 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     exec("+"*5969+"1")
004 |     ~~~~^^^^^^^^^^^^^^
005 | MemoryError: Parser stack overflowed - Python source too complex to parse
subtle viper
#

technically 5970

grave grail
grave grail
#

Just weird 🥴

#

(do note that it's pydroid

subtle viper
#

works differently for different platforms, i guess.

grave grail
#

!e

exec("+".join("1" for _ in range(5970)))
night quarryBOT
grave grail
#

...

subtle viper
#

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

grave grail
#

Oh well

subtle viper
night quarryBOT
# subtle viper !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 "/home/main.py", line 1, in <module>
003 |     exec("+".join("x"*9997))
004 |     ~~~~^^^^^^^^^^^^^^^^^^^^
005 | RecursionError: maximum recursion depth exceeded during compilation
subtle viper
#

i guess it is sort of a compile time recursion error

austere mauve
#

Platform dependence is a bit disappointing, but I should expect it...

restive void
#

Screw ?. etc., I want a .= operator.

#
s .=replace("foo", "bar")
versed eagle
#

it would make string operations nicer

oblique ibex
#

Okay but does it chain

magic wraith
#

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

tranquil yarrow
#

hm, no, calling sys.setrecursionlimit doesn't seem to affect anything

errant crescent
night quarryBOT
#

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;```
subtle viper
#

that's because it's in its own state for 3.13 (and below)

night quarryBOT
#

Include/cpython/pystate.h line 226

#  define Py_C_RECURSION_LIMIT 10000```
tranquil yarrow
#

makes sense, thanks!!

rich lagoon
#

Is there a way to error handling in inline expressions in python?

subtle viper
magic wraith
#

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

rapid sparrow
#

!e

(lambda _, __, ___, ____:
    eval(''.
    join([bytes([_____]).
    decode() for
    _____\
    in [(____+((___<<___<<_)-(___<<_))),(____+((___<<___<<_)-___)),
    (____+(___<<_)+_),(____+((___<<___<<_)-(___<<___))+(___)),
    (____+(___<<___<<_)),((___<<___)+(___<<___<<___)),((___<<___<<___)+___),
    (____+(___<<_)),(____+_),(____+(___<<___)),(____+(___<<___)),
    (____+(___<<___)+___+_),(___<<___<<___),(____+(___<<___<<_)+
    (___+_)),(____+(___&___&___^_|___)+(___|_|__+___)+
    (___|_)+___),(____+(___<<___<<_)-(___+___<<_)+
    (___<<___)-___),(____+(___<<___)),____,
    ((___<<___<<___)+___),((___<<___<<___)+(___<<___)+_)]]))
)(_:=([([map(int, 
(__builtins__.len({}.__iter__.
__repr__.__subclasshook__.
__init__.__name__).__subclasshook__.
__init__).__str__())])]!=
{...==...:[...,...][0:[]!=[]==[
{}.__iter__.__subclasshook__]]}),__:=~-_,(_<<(_^__)), ((((((_ << _ << _) 
>> __ >> __ >> __) ** 
(_ << _ << _)) >> _)-(_ 
<< _ << _ << _ << _ << _)+(_<<_<<_))))
night quarryBOT
rapid sparrow
#

!e

(
  lambda _, __, ___, ____: eval(
    "".join(
      [
        bytes([_____]).decode()
        for _____ in [
          (____ + ((___ << ___ << _) - (___ << _))),
          (____ + ((___ << ___ << _) - ___)),
          (____ + (___ << _) + _),
          (____ + ((___ << ___ << _) - (___ << ___)) + (___)),
          (____ + (___ << ___ << _)),
          ((___ << ___) + (___ << ___ << ___)),
          ((___ << ___ << ___) + ___),
          (____ + (___ << _)),
          (____ + _),
          (____ + (___ << ___)),
          (____ + (___ << ___)),
          (____ + (___ << ___) + ___ + _),
          (___ << ___ << ___),
          (____ + (___ << ___ << _) + (___ + _)),
          (
            ____
            + (___ & ___ & ___ ^ _ | ___)
            + (___ | _ | __ + ___)
            + (___ | _)
            + ___
          ),
          (____ + (___ << ___ << _) - (___ + ___ << _) + (___ << ___) - ___),
          (____ + (___ << ___)),
          ____,
          ((___ << ___ << ___) + ___),
          ((___ << ___ << ___) + (___ << ___) + _),
        ]
      ]
    )
  )
)(
  _ := (
    [
      (
        [
          map(
            int,
            (
              __builtins__.len(
                {}.__iter__.__repr__.__subclasshook__.__init__.__name__
              ).__subclasshook__.__init__
            ).__str__(),
          )
        ]
      )
    ]
    != {... == ...: [..., ...][0 : [] != [] == [{}.__iter__.__subclasshook__]]}
  ),
  __ := ~-_,
  (_ << (_ ^ __)),
  (
    (
      ((((_ << _ << _) >> __ >> __ >> __) ** (_ << _ << _)) >> _)
      - (_ << _ << _ << _ << _ << _)
      + (_ << _ << _)
    )
  ),
)
night quarryBOT
rapid sparrow
#

!e

(
  lambda _, __, ___, ____: eval(
    "".join(
      [
        bytes([_____]).decode()
        for _____ in [
          (____ + ((___ << ___ << _) - (___ << _))),
          (____ + ((___ << ___ << _) - ___)),
          (____ + (___ << _) + _),
          (____ + ((___ << ___ << _) - (___ << ___)) + (___)),
          (____ + (___ << ___ << _)),
          ((___ << ___) + (___ << ___ << ___)),
          ((___ << ___ << ___) + ___),
          (____ + (___ << _)),
          (____ + _),
          (____ + (___ << ___)),
          (____ + (___ << ___)),
          (____ + (___ << ___) + ___ + _),
          (___ << ___ << ___),
          (____ + (___ << ___ << _) + (___ + _)),
          (
            ____
            + (___ & ___ & ___ ^ _ | ___)
            + (___ | _ | __ + ___)
            + (___ | _)
            + ___
          ),
          (____ + (___ << ___ << _) - (___ + ___ << _) + (___ << ___) - ___),
          (____ + (___ << ___)),
          ____,
          ((___ << ___ << ___) + ___),
          ((___ << ___ << ___) + (___ << ___) + _),
        ]
      ]
    )
  )
)(True, 0, 2, 100)
night quarryBOT
rapid sparrow
#

!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]])
)```
night quarryBOT
rapid sparrow
#

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]])
)```
night quarryBOT
subtle viper
#

!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)

night quarryBOT
subtle viper
#

oh..

rapid sparrow
#

!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__(_),
        ),
      )
    )
  ),
)
night quarryBOT
rapid sparrow
#

interesting

#

the top level expression is a tuple

#

a walrus assignment then a call to __builtins__.__getattribute__ ?

shrewd ore
wary python
#

yeah you could definitely replace all the __builtins__.__dir__().__len__()s

rapid sparrow
#

I was figuring out the structure of it

shrewd ore
fluid pumice
#

Hehehehe

#

You did a good job deobfuscating it, but it's not really how it is supposed to work

shrewd ore
#

!e

night quarryBOT
#
Missing required argument

code

fluid pumice
#

In simplest words, it is just print("hello world") but as an integer, all those bit shifting are there for confusion

rapid sparrow
#

aren't those for getting the character values

fluid pumice
#

The whole program is just print("hello world")

fluid pumice
#

Oh no, you're right. My bad

rapid sparrow
#

like I assume it ends to being eval(''.join(["p", "r", "i", "n", "t",...]))

fluid pumice
#

I mixed it with my another obfuscated program

shrewd ore
rapid sparrow
#

it's a lot to dissect

#

i need a better library to work with asts than ast

#

ast sucks

wary python
#

okay no

#

not close enough

#

its more like
eval("print")

rich lagoon
#

!pypi astor

night quarryBOT
#

Read/rewrite/write Python ASTs

Released on <t:1575942635:D>.

wary python
#

@rapid sparrow hows it going

grave grail
rapid sparrow
rapid sparrow
rapid sparrow
#

interesting, that's from astor.dump_tree

#

remind me a little bit of what llvm gives you when you dump a syntax tree

wary python
grave grail
#

hmm, might be slightly different, but still

rapid sparrow
cerulean wadi
#

Nano Banana is cool

restive void
cerulean wadi
#

Maybe ai picture and ai is algorithms

#

But actually it looks cool

restive void
#

Well, it's not on-topic for #esoteric-python, which you would realize if you'd read the topic.

cerulean wadi
#

plus1 yeah

#

my bad

rapid sparrow
#

reporting in

wanton tundra
#

!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)
night quarryBOT
# wanton tundra !e ```py def co_print(function): code = function.__code__ attr = [*filt...

: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

rapid sparrow
#

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)
night quarryBOT
# rapid sparrow !e ```py def co_print(function): code = function.__code__ attr = [*filt...

: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

wanton tundra
#

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

rapid sparrow
#

what's subclass 36 and 12

wanton tundra
#

function and code

#

respectively

rapid sparrow
#

ahh

wanton tundra
#

and thats one of many reasons this code only works in 3.13

#

code object changes surprisingly often pithink

rapid sparrow
#

that's cool

rapid sparrow
#

i know the bytecode does

#

but I guess code object too

wanton tundra
#

literally bytecode

rapid sparrow
#

how many instructions are there

wanton tundra
#

in that string ?

rapid sparrow
#

yeah

wanton tundra
#

anywhere btw 2 and 4

rapid sparrow
#

interesting

wanton tundra
#

!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))
night quarryBOT
# wanton tundra !e ```py b = 5 import dis def co_print(function): code = function.__code__ ...

: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

wanton tundra
#

cant u

rapid sparrow
#

nice

#

yeah haha

wanton tundra
#

u should see the file

rapid sparrow
#

nice little helper functions

wanton tundra
#

literally scribles of a madman

rapid sparrow
#

well you win the investigation award

wanton tundra
#

also this one of the projects where i see this very annoying "feature" of python

wanton tundra
#

if u look at the output

#

u gonna see this byte string

#

tell me, what byte is S or $

#

or n or U

rapid sparrow
#

idk

wanton tundra
#

well i will tell u

#

!e

print(hex(ord('U')))
night quarryBOT
wanton tundra
#

!e

print(b'\x55')
night quarryBOT
wanton tundra
#

🎉

#

this shit made me go crazy when i first discovered in my other project

rapid sparrow
#

what

#

is that weird

wanton tundra
#

instead of printing x55 as the byte

rapid sparrow
#

oh

wanton tundra
#

it prints the capital U

#

for some damn reason

rapid sparrow
#

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

wanton tundra
#
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

rapid sparrow
#

lol

#

i can see how

#

it doesn't look like a byte

wanton tundra
#

either way its stupid that it converts like that as default behavior

rapid sparrow
#

yeah

wanton tundra
#

!e

print(rb'\x55')
night quarryBOT
wanton tundra
#

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

rapid sparrow
#

!e

x = b"hello"
for b in x:
  print(hex(b))```
wanton tundra
night quarryBOT
wanton tundra
#

!e

print(b'\x68\x65\x6c\x6c\x6f')
night quarryBOT
wanton tundra
rapid sparrow
#

why

wanton tundra
#

C code wasnt reading the last byte of file cause of how fget (?) does things

#

python was

rapid sparrow
#

wtf

wanton tundra
#

it was so stupid

rapid sparrow
#

how stupid

wanton tundra
#

combine that and the byte string with {

#

that project tested my sanity

#

which i think has dried up at this point

rapid sparrow
#

yeah fr

wanton tundra
cunning lava
#

sorry to be a nuisance yall but does anyone know where to find help on python apis?

wanton tundra
#

u prob gonna laugh

rapid sparrow
#

what one

wanton tundra
rapid sparrow
wanton tundra
rapid sparrow
wanton tundra
#

if u never seen pokemon code

#

this is gonna be a treat

rapid sparrow
#

i actually have seen that repo

#

is quite something

#

emerald is my favorite pokemon

wanton tundra
#

prob mine too

#

firered up there tho

rapid sparrow
#

yeah

#

it's amazing that they got all that code together

#

and it compiles a perfect pokemon emerald

wanton tundra
# rapid sparrow oh gosh
    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

cunning lava
wanton tundra
#

see that :size-1 and + 0 byte at bottom

#

thats the fix to behavior i said earlier

#

so goddamn stupid

rapid sparrow
#

did you ask in main and nobody there to help?

wanton tundra
rapid sparrow
#

oh

#

try there

#

yeah

wanton tundra
rapid sparrow
#

!pypi spotipy

night quarryBOT
#

A light weight Python library for the Spotify Web API

Released on <t:1740641534:D>.

rapid sparrow
#

that's also a thing apparently @cunning lava

rapid sparrow
cunning lava
wanton tundra
rapid sparrow
#

yeah

#

is fget broken

#

shouldn't it read the last byte

wanton tundra
#

something somethign EOF

#

anyways

#

that stupid project that made me go mad aside

#

do u know about pascal triangle in math

rapid sparrow
#

maybe that's why things always warn if you don't end with an empty line

rapid sparrow
#

maybe

#

the 1, 2 2 thing?

#

or whatever it is

wanton tundra
rapid sparrow
#

yeah that

wanton tundra
#

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]})()()()()()()()()()()()()()()()()
night quarryBOT
rapid sparrow
#

what the hell lol

#

did you write that

wanton tundra
#

yes

#

lmfao

#

its silly

rapid sparrow
#

that's funny

wanton tundra
#

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]})()()()()
night quarryBOT
rapid sparrow
#

i wondered if that's what that was

wanton tundra
#

man i love __call__

#

u can do so mcuh silly stuff with it

rapid sparrow
#

I'll have to mess around with it

wanton tundra
rapid sparrow
#

looks like a game board

wanton tundra
viral ravine
#

hello im a newbie to python can anyone advice me a playlist from youtube to learn it?

rapid sparrow
#

Android added Windows 10 blur

wanton tundra
#

its a very funny lil intermediate ish project

rapid sparrow
wanton tundra
#

def not newbie friendly

#

the codes posted here are damn near war crimes

rapid sparrow
#

how are ppl coming here for general questions

wanton tundra
rapid sparrow
#

lol

viral ravine
wanton tundra
#

the lil spiral of numbers

rapid sparrow
#

it's a better channel to ask in

#

and there's some smart ppl online rn

wanton tundra
#

already

rapid sparrow
#

lol

wanton tundra
#

which is why i ignored that

#

eivl is already answering that question of theirs

rapid sparrow
#

good

wanton tundra
#

anyways that guy aside

wanton tundra
rapid sparrow
#

yes

wanton tundra
#

now auto generating that in code

#

is a fun task

rapid sparrow
#

i hope you use 2d list

#

and not folded 1d list

wanton tundra
#

i choose a uh

rapid sparrow
#

idk why ppl always do that

wanton tundra
#

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])
rapid sparrow
#

they try to make tic tac toe with a 1x9 list

#

then run into problems

wanton tundra
rapid sparrow
wanton tundra
#
# 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]
rapid sparrow
#

is *[ legal

wanton tundra
wanton tundra
#

cause of input

rapid sparrow
#

!e print(*[])

night quarryBOT
rapid sparrow
#

globals().update is good

wanton tundra
#

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

rapid sparrow
#

you went with weights on the bat

#

did you try making it not one line first

wanton tundra
#

i did but got bored so halfway throught i just said "im onelining this anyways so fuck it im do it now"

rapid sparrow
#

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

wanton tundra
#

fun fact that one line is O(n^4) time complexity, its absolutely god awful

rapid sparrow
#

nobody understands

rapid sparrow
#

Linux usually

wanton tundra
#

u should use python -i

rapid sparrow
#

i know of it

wanton tundra
#

sick dont need to explain

rapid sparrow
#

but don't use that often

wanton tundra
#

win win

rapid sparrow
#

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

rapid sparrow
#

no

wanton tundra
#

!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])
night quarryBOT
wanton tundra
#

guess im run it here

rapid sparrow
wanton tundra
#

very funny lil 1 liner

#

anyways

rapid sparrow
#

it works

#

it even pads the #

wanton tundra
#

fancy isnt it

rapid sparrow
#

yes

wanton tundra
#

thats zfill doing it

rapid sparrow
#

very nice one liner

wanton tundra
#

wanna see it

rapid sparrow
#

k

wanton tundra
#

!e print('H')

night quarryBOT
wanton tundra
#

cool isnt it

rapid sparrow
night quarryBOT
#
Missing required argument

code

night quarryBOT
wanton tundra
#

just joking here is the real thing

rapid sparrow
#

what the hell

wanton tundra
#

dont u as well

wanton tundra
#

lmfao

rapid sparrow
#

i do love them

#

and they're the only way to make functions on a single line besides exec

#

which is horrible

wanton tundra
rapid sparrow
#

oh

wanton tundra
#

not nearly as practical as lambdas

#

but

#

rofl

rapid sparrow
#

well that's a bit different

#

the only way without manually cobbling together a code object from scratch

wanton tundra
rapid sparrow
#

i thought i would make shellcode in python

#

and gave up

wanton tundra
#

its actually a very simple algorithm that i just applied to itself like 4 times

rapid sparrow
#

i thought writing a pyc to disk was lame

wanton tundra
#

i really need to learn all the weird .py extensions like .pyi and .pyc

rapid sparrow
#

there's pyd and pyo

wanton tundra
#

cant wait for the esoteric codes my brain would think of with them

rapid sparrow
#

at least

#

there's a constant in stdlib someplace with them

#

probably in importlib somewhere

wanton tundra
# wanton tundra its actually a very simple algorithm that i just applied to itself like 4 times

!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
night quarryBOT
wanton tundra
#

it was this algorithm if u curious

wanton tundra
rapid sparrow
wanton tundra
#

that doc i wrote by hand

rapid sparrow
#

it's like OPTIMIZED_EXTENSION_SUFFIXES or something like that

wanton tundra
#

but now u make me wonder

rapid sparrow
wanton tundra
#

how well do those auto-doc things do to my eso codes

rapid sparrow
#

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

wanton tundra
#

C# is fun

rapid sparrow
#

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

rapid sparrow
#

better than java

wanton tundra
#

i agree

#

althought terraria source code is def a legal code

errant crescent
night quarryBOT
errant crescent
#

!e
print(chr(72))

night quarryBOT
wanton tundra
wanton tundra
#

@tropic night so close, just gotta fix that bunch of empty list at bottom

night quarryBOT
tropic night
#

you are close now

wanton tundra
# tropic night 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)
night quarryBOT
wanton tundra
#

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)
night quarryBOT
# wanton tundra !e ```py (subs := lambda cls, indent=' ', extra = '': print(f'{indent}{extra}{c...

: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

wanton tundra
#

and this one adds the lil L pithink

silk warren
#

yo

wanton tundra
#

That code i replied to basically as close as i get to bottom to top code execution

silk warren
#

which

wanton tundra
# silk warren 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
night quarryBOT
silk warren
#

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)

wanton tundra
#

ig only some1 like eivl who knows too much about the inwards could really tell us

silk warren
#

true

silk warren
#

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

wanton tundra
silk warren
#

yea, i'm trying to find this thread

wanton tundra
silk warren
#

yea

silk warren
silk warren
#

after i refresh my memory about it

karmic pumice
silk warren
#

u read python commands from top to bottom

wanton tundra
glass pollen
#

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                                  ').
arctic elm
glass pollen
#

what did you place in the file?

arctic elm
#

python for whatever reason treats \r as a newline

glass pollen
#

like in vim?

#
print('no').prin
t=(.lambda x:Non
e).print('roblox
').
arctic elm
#

literally just

print('no')
print=(
lambda x:None)
print('roblox')
```but replacing \n with \r
glass pollen
#

how do you replace

arctic elm
#

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
glass pollen
#

ok i got it

#

cool

#

but why does when its cat it prints only the last part?

proper vault
#

\r returns the cursor to the start of the line, without going to a new line

wanton tundra
#

!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)
night quarryBOT
rapid sparrow
#

what the

wanton tundra
#

recursive nested classes !

rapid sparrow
#

does it print every time you access a member

wanton tundra
#

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)
night quarryBOT
wanton tundra
#

as u can see

rapid sparrow
#

lol where do you make the class

wanton tundra
#

i make literally like 11 classes

#

in that code

wanton tundra
cerulean wadi
#
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])

night quarryBOT
cerulean wadi
#

!e print(sum([ord(c) for c in 'lemon'] * 2))

night quarryBOT
cerulean wadi
#

(: Try to understand it

subtle viper
#

!e ```py
print([*range(10)[-2::-4]])
print(sum(b'lemon')*2)

night quarryBOT
magic wraith
#

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

earnest wing
#

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

wanton tundra
subtle viper
#

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

magic wraith
#

x, y, z = solve(a, b, c, d, e, f)

earnest wing
#

it just means putting cases in your code

nocturne osprey
#

!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()```

night quarryBOT
magic wraith
#

!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)

night quarryBOT
# magic wraith !e ```py import dis x2 = lambda:... x2.__code__ = x2.__code__.replace(co_nlocals...

: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

night quarryBOT
#

:x: Your 3.13 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     import pygame
004 | ModuleNotFoundError: No module named 'pygame'
#

:x: Your 3.13 eval job has completed with return code 1.

001 |   File "/home/main.py", line 1
002 |     pip install pygame
003 |         ^^^^^^^
004 | SyntaxError: invalid syntax
warped oyster
#

What's the meaning of esoteric?

serene stratus
warped oyster
#

Thanks for the heads up!

serene stratus
#

These concepts exist in most (all?) languages

magic wraith
#

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

earnest wing
#

you'll find it goes pretty deep once you deal with class loaders and reflection more generally

grave grail
#

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

floral meteor
#

!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
night quarryBOT
floral meteor
#

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=256
8-1;self.i=0;self.o=output(victim)
@property
def mem(self):return(c_byte
(256
8-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);

night quarryBOT
floral meteor
#

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

floral meteor
#

!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=256
8-1;self.i=0;self.o=output(victim)
@property
def mem(self):return(c_byte
(256
8-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);

night quarryBOT
floral meteor
#

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.

warped oyster
versed eagle
#

its been a long time since you've been around here

mystic carbon
short yarrow
#

e! print hello

#

!e

night quarryBOT
#
Missing required argument

code

short yarrow
#

!e print hello

night quarryBOT
#

:x: Your 3.13 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 2, in <module>
003 |     from keyboard import is_pressed as مضغوط
004 | ModuleNotFoundError: No module named 'keyboard'
pine seal
night quarryBOT
wary python
#

arabic python

magic wraith
#

the very legal syntax

floral meteor
restive void
subtle viper
#

i think it's still achievable in the same contexts

#

just a different way-

rough moat
#
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

rough moat
magic wraith
#
good_bool = lambda b: not not b```
floral meteor
wanton tundra
#

@shrewd ore

wanton tundra
night quarryBOT
wanton tundra
#

do u like lambdas

shrewd ore
shrewd ore
wanton tundra
shrewd ore
#

now i can say that this uses only 2 global variables but i can be wrong

shrewd ore
#

H

#

how do you even find out about this wtf

wanton tundra
#

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
night quarryBOT
wanton tundra
#

this explains the algorithm if u want to understand it

wanton tundra
shrewd ore
wanton tundra
#

@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')
night quarryBOT
# wanton tundra !e ```py WIDTH = 10 tiles = [". ", "[]", "[]"] grid = [ 0, 0, 0, 0, 0, 0, 0...

: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

wanton tundra
#

this is def a creation

#

that string format is the best part

spark gale
wanton tundra
#

damnit

#

oh well back to recursive lambda

spark gale
# wanton tundra damnit

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

wanton tundra
#

just thought i could get by easy

#

guess not

#

recursive lambda time

#

lets reinvent batched

spark gale
#

you don't really need the f-string there, your not using it

wanton tundra
#

adds flavour

spark gale
#

in that case add an r in-front of it too to add more flavor, reminds me of rm -rf then 😁

wanton tundra
#

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))
night quarryBOT
wanton tundra
#

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))
spark gale
#

not really more compact then a comprehension anymore though

night quarryBOT
wanton tundra
spark gale
#

haha

wanton tundra
#

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))
night quarryBOT
wanton tundra
#

cause it seems to be giving every batch one at a time but never all present at same time

spark gale
#

yeah, all bow to the mighty walrus that saves our day

wanton tundra
#

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])
night quarryBOT
wanton tundra
#

its even crazier when u realized its like O(n^4) in time AND space complexity

spark gale
#

lots of comprehensions in there

wanton tundra
#

as well

#

that [0] really was issue huh

spark gale
#

yeah, you can probably make it more compact with a few walruses

#

the other one i mean

wanton tundra
#

!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

night quarryBOT
wanton tundra
#

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)
)
night quarryBOT
wanton tundra
#

THERE

#

thats the magical combination of unpackers

spark gale
#

yeah, three we go

wanton tundra
#

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')
night quarryBOT
# wanton tundra !e ```py WIDTH = 10 tiles = [". ", "[]", "[]"] grid = [ 0, 0, 0, 0, 0, 0, 0...

: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

wanton tundra
#

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')
night quarryBOT
# wanton tundra !e ```py WIDTH = 10 tiles = [". ", "[]", "[]"] grid = [ 0, 0, 0, 0, 0, 0, 0...

: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

wanton tundra
#

and this version also works ig

spark gale
#

yeah, if you can make it into one line you should 😉

wanton tundra
#

its one of the funniest tricks i came up with during my esopy adventures

spark gale
#

yeah i see it now, damn

wanton tundra
#

and it actually being legal syntax

wanton tundra
#

!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)
night quarryBOT
wanton tundra
#

what u think of my latest hello world

spark gale
#

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

wanton tundra
#

the other one is what bot prints

#

honestly when i found out about that "feature" of byte strings i nearly lost it

spark gale
#

yeah, saw that

wanton tundra
#

!e

print(b'\xA8\x7d')
night quarryBOT
wanton tundra
#

like why

stable summit
spark gale
# stable summit

it's just your big calculation 984697963845**7438888888888886 taking a lot of time

stable summit
#

!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())
night quarryBOT
# stable summit !e ```python def ytrhkhdkhyhkrhykkjhjtkjhjkdhkjdkkhjhtkyjdhkjhydkjytkdt() -> int...

:x: Your 3.13 eval job has completed with return code 1.

001 | enter your name:Traceback (most recent call last):
002 |   File "/home/main.py", line 15, in <module>
003 |     exit(ytrhkhdkhyhkrhykkjhjtkjhjkdhkjdkkhjhtkyjdhkjhydkjytkdt())
004 |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
005 |   File "/home/main.py", line 2, in ytrhkhdkhyhkrhykkjhjtkjhjkdhkjdkkhjhtkyjdhkjhydkjytkdt
006 |     klghdkhglksgsgs = input("enter your name:")
007 | EOFError: EOF when reading a line
stable summit
#

:C

spark gale
stable summit
#

oh ok

spark gale
#

and the long file name and function name and variable names doesn't do much to obfuscate things much, just takes up space

stable summit
#

i wonder how long it will take...

spark gale
stable summit
#

idk lol

#

im stress testing python

formal sandal
#

!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))
night quarryBOT
versed eagle
# wanton tundra walrus is what makes this readable

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

magic wraith
stable hornet
magic wraith
#

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
austere mauve
#

The

[expr1, expr2, expr3]

Is probably the best.

magic wraith
#

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')

night quarryBOT
magic wraith
#

there, the only difference is the SETUP_ANNOTATIONS at the beginning

#

!e 3.13 py p = print p("first")[p("second")]: p("third")

night quarryBOT
pastel lagoon
night quarryBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

magic wraith
#

!e py import dis dis.dis('a;b;c') dis.dis('a[b]:c')

night quarryBOT
magic wraith
#

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)```
raven hemlock
#

i need some help for my python asignment that in need to submit today

stable hornet
wanton tundra
#

!e

eval(f'{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c}')
night quarryBOT
rapid sparrow
#

what's: c, character?

silk warren
#

what does :c do in f'

rapid sparrow
#

is this an inplace subtract

silk warren
#

i see, its print("h")

wanton tundra
#

!e

print(ord('h'))
print(chr(0x72))
print(f'{114:c}')
night quarryBOT
rapid sparrow
#

!e print(---4)

night quarryBOT
rapid sparrow
#

oh

silk warren
#

eval("print("h")") or something

wanton tundra
#

along those lines ye

rapid sparrow
#

!e x = 4; print(---x)

night quarryBOT
wanton tundra
#

not quite jsfuck level but fun enough i would say pithink

rapid sparrow
# silk warren eval("print(\"h\")") or something

!e print(f"{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c,}")

night quarryBOT
# rapid sparrow !e print(f"{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~...

:x: Your 3.13 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     print(f"{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0:c,}")
004 |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | ValueError: Invalid format specifier 'c,' for object of type 'int'
rapid sparrow
wanton tundra
#

,

silk warren
#

using eval fstring and :c

#

u can create everything

wanton tundra
#

in like 9 chars if u not counting eval()