#esoteric-python

1 messages · Page 155 of 1

floral meteor
#

the reason being I usually do something to xmem before i overwrite ymem

wheat river
#

!e

from string import*
print(''.join([*{*(ascii_letters+digits)}][:16]))
night quarryBOT
#

@wheat river :white_check_mark: Your eval job has completed with return code 0.

gYdy563sfpzMnVrP
floral meteor
#

le random

wheat river
#

!e

from string import*
print(''.join({*(ascii_letters+digits)})[:16])
night quarryBOT
#

@wheat river :white_check_mark: Your eval job has completed with return code 0.

JsvErFW9eD5cw7GU
versed eagle
floral meteor
#

it just shuffles it

versed eagle
#

shufflebag random

#

alr

sick hound
#

what's the coolest thing you can do in python in just a few lines?

floral meteor
#

idk

sick hound
#
print("""Fatal error: death.py activated: idk""")
floral meteor
#

!e ```py
from ctypes import*

def mutate(target):
size = c_longlong.from_address(id(target)+16).value
a = (c_char*size).from_address(id(target)+48)
(b:=[*map(ord,a)])[-1]+=1
a.value=bytes(b)

s = "Hello, World "
mutate(s)
print(s)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
sick hound
#

maybe fix it?

floral meteor
#

!e ```py
from fishhook import hook
from ctypes import*

@hook(str)
def setitem(self, key, value):
sbase = c_longlong.from_address(id(self)+16)
size0 = sbase.value
(a:=[self])[key]=value
a=''.join(a)
size1 = c_longlong.from_address(id(a)+16).value
a=a.encode()
sbase.value = size1
(c_char
size1).from_address(id(self)+48).value=a

a = "Hell rld!"
a[4],*a[6:6] = 'oWo'
print(a)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello World!
floral meteor
#

i dunno why i stored size0

#

I guess I thought I'd need it.

#

!e ```py
from fishhook import hook
from ctypes import*

@hook(str)
def setitem(self, key, value):
sbase = c_longlong.from_address(id(self)+16)
size0 = sbase.value
(a:=[self])[key]=value
a=''.join(a)
size1 = c_longlong.from_address(id(a)+16).value
a=a.encode()
sbase.value = size1
(c_char
size1).from_address(id(self)+48).value=a

@hook(str)
def iadd(self, s):
sizemem = c_longlong.from_address(id(self)+16)
size = sizemem.value = sizemem.value + len(s)
(c_char*len(s)).from_address(id(self)+48+size).value = s.encode()
return self

a = "Hell rld"
a[4],*a[6:6] = 'oWo'
a += chr(33)
print(a)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello World!
floral meteor
#

I have no shortage of str mutating craziness.

#

!e ```py
from fishhook import hook
from ctypes import*

@hook(str)
def call(self, other):
o = self.join(other)
size = c_longlong.from_address(id(o)+16).value
c_longlong.from_address(id(self)+16).value = size
(c_char
size).from_address(id(self)+48).value = o.encode()
return self

a = [*"Hello, World!"]
s = ''
s(*a)
print(s)

b = "Hello", "World!"
s = ", "
print(s(*b))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Hello, World!
002 | Hello, World!
unreal echo
#

im stealing this

#

!e
print("".join({*(import('string').ascii_letters+import('string').digits)})[:16])

night quarryBOT
#

@unreal echo :white_check_mark: Your eval job has completed with return code 0.

PsCI6GSi4muk2fcR
unreal echo
#

!e
print("".join({*(import('string').ascii_letters+import('string').digits)})[:16])

night quarryBOT
#

@unreal echo :white_check_mark: Your eval job has completed with return code 0.

076jXP4g1s5zABYF
floral meteor
#

!e ```py
from fishhook import hook
from ctypes import*

@hook(int)
def getitem(self, key):
size = c_longlong.from_address(id(self)+16).value
obase = (c_long*size).from_address(id(self)+24)
return[*obase][key]

@hook(int)
def setitem(self, key, value):
size = c_longlong.from_address(id(self)+16)
obase = (c_long*size.value).from_address(id(self)+24)
(a:=[obase])[key]=value
size.value = size = len(a)
(c_long
size).from_address(id(self)+24)[:] = *a,

n = 1073741893
n[1]-=1
print(n)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

1073741893
floral meteor
#

ummm that's different

#

are integers different in memory in 3.10 than 3.9?

#

because in 3.9 I very much can mutate integers as though they are arrays of long integers

#

!e ```py
from fishhook import hook
from ctypes import*

@hook(int)
def getitem(self, key):
size = c_longlong.from_address(id(self)+16).value
obase = (c_long*size).from_address(id(self)+24)
return[*obase][key]

@hook(int)
def setitem(self, key, value):
size = c_longlong.from_address(id(self)+16)
obase = (c_long*size.value).from_address(id(self)+24)
(a:=[obase])[key]=value
size.value = size = len(a)
(c_long
size).from_address(id(self)+24)[:] = *a,

n = 70
n[0]-=1
print(n)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

69
floral meteor
#

immutable objects are mutable, you just gotta do it right

#

!e the size can change, too! ```py
from fishhook import hook
from ctypes import*

@hook(int)
def getitem(self, key):
size = c_longlong.from_address(id(self)+16).value
obase = (c_long*size).from_address(id(self)+24)
return[*obase][key]

@hook(int)
def setitem(self, key, value):
size = c_longlong.from_address(id(self)+16)
obase = (c_long*size.value).from_address(id(self)+24)
(a:=[obase])[key]=value
size.value = size = len(a)
(c_long
size).from_address(id(self)+24)[:] = *a,

n = 1073741893
n[:]=n[0],
print(n)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

69
floral meteor
#

!e ```py
from ctypes import*
c, s = 6278066737626506568, 143418749551, ""
c_longlong.from_address(id(s)+16).value = 13
(c_longlong
2).from_address(id(s)+48)[:] = c
print(s)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
bronze agate
#

!e ```python
from random import choice, seed
from string import ascii_lowercase

seed(1337_3068)
print( ''.join(choice(ascii_lowercase) for _ in range(5)) )```

night quarryBOT
#

@bronze agate :white_check_mark: Your eval job has completed with return code 0.

hello
burnt pasture
wary veldt
#

i'm guessing just brute force

burnt pasture
fleet bridge
#

!e print(__import__('sys').version)

night quarryBOT
#

@fleet bridge :white_check_mark: Your eval job has completed with return code 0.

3.10.5 (main, Jun 23 2022, 11:04:19) [GCC 8.3.0]
sick hound
floral meteor
#

I already did last year.

#

some people probably still have ptsd from it

upbeat sonnet
#

!e ```py
print(['a', 'b'][:1])

night quarryBOT
#

@upbeat sonnet :white_check_mark: Your eval job has completed with return code 0.

['a']
upbeat sonnet
#

ah

sullen kayak
#

how the hell is this safely sandboxed?

maiden blaze
#

nsjail

quartz wave
#

!e ```py
raise SystemExit(519257187133393213219482149721)

night quarryBOT
#

@quartz wave :warning: Your eval job has failed.

A fatal NsJail error occurred
quartz wave
#

which you can crash

#

but not make the bot go down

wary veldt
surreal spruce
#

not sure if this is the right place to ask. but if I want to have python respect K8s pod memory limits, should I be using the resource library to set a limit processes (and all children when they start up) on RLIMIT_AS or RLIMIT_RSS?

because I've been reading https://medium.com/@eng.mohamed.m.saeed/memory-working-set-vs-memory-rss-in-kubernetes-which-one-you-should-monitor-8ef77bf0acee and https://stackoverflow.com/questions/3043709/resident-set-size-rss-limit-has-no-effect/33525161#33525161 , it seems that RLIMIT_AS is virtual memory and K8 according to the blog post seems to be indicating that what it checks for is RSS (+/- another measurement)

floral meteor
#

NsJail...
so this whole time I have been torturing python in a prison?
now I feel evil.

fast ether
#

How do you obfuscate your code?

onyx jacinth
#

U can use many already available libraries to do it

timid kraken
#

Isn't there some trick to invoking a callable immediately with @?

#

Swear I've seen it in here before

floral meteor
#

!e ```py
from ctypes import*
c, s = 1.8492449856613858e+31, 2.0617683563037353e-19, 4.965104148112166e+28, 1.9442585761726862e+31, 7.212836810607206e+22, 4.484892800418306e+21, 7.618957098799247e+31, 2.0282509978830866e-19, 1.8062088434213888e+28, 4.611424305245842e+24, 7.758925607679937e+26, 5.216663559459711e-11, ""
c_longlong.from_address(id(s)+16).value = 48
(c_float
12).from_address(id(s)+48)[:] = c
print(s)

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 139 (SIGSEGV).

This is an obfuscated script to print this line.
floral meteor
#

segfault strikes again

#

oh i see why it segfaults. "" is interned

#

!e ```py
from ctypes import*
c = 18492449856613858175293792976896/1,498505/2417851639229258349412352,49651041481121658560768376832/1,19442585761726862141087316705280/1,72128368106072063344640/1,4484892800418305802240/1,76189570987992473289570266382336/1,490401/2417851639229258349412352,18062088434213887534763606016/1,4611424305245842149736448/1,775892560767993666621931520/1,15036009/288230376151711744
olength = c_longlong.from_address(id('')+16)
obase = (c_float*12).from_address(id('')+48)
olength.value = 48
backup = *obase,
obase[:] = c
print('')
olength.value = 0
obase[:] = backup

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

This is an obfuscated script to print this line.
floral meteor
#

I set 'f' = '' instead of f = '' by accident...

royal whale
floral meteor
#

!e ```py
@print
@lambda s:s.doc
class s:
"""yes"""

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

yes
drowsy cobalt
#

Oh wow, you can write reduce in list comprehensions now, thanks to walrus operator

#

!e ```py
result = 1
mul = lambda a, b: a*b

accumulated = [result := mul(result, n) for n in range(1, 7)]

print(result, ':', accumulated)

night quarryBOT
#

@drowsy cobalt :white_check_mark: Your eval job has completed with return code 0.

720 : [1, 2, 6, 24, 120, 720]
drowsy cobalt
#

for very simple thing you can replace the lambda with just result := result * n

versed eagle
#

!e

reducer = (lambda start_val=1, loops=6:[result:=start_val, accumulated:=[result:=result*n for n in range(1, loops+1)], f"{result} : {str(accumulated)}"][2])
print(reducer())
night quarryBOT
#

@versed eagle :white_check_mark: Your eval job has completed with return code 0.

720 : [1, 2, 6, 24, 120, 720]
versed eagle
#

there we go

#

!e

reducer = (lambda start_val=1, loops=6:[result:=start_val, accumulated:=[result:=result*n for n in range(1, loops+1)], f"{result} : {str(accumulated)}"][2])
print(reducer(loops=10))
night quarryBOT
#

@versed eagle :white_check_mark: Your eval job has completed with return code 0.

3628800 : [1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800]
versed eagle
#

:D

languid hare
#

!e

def fuckit(func):
    def inner(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except:
            pass
    return inner

@fuckit
def error():
    0/0
    1 + None
    name_error

error()
print("all good")
night quarryBOT
#

@languid hare :white_check_mark: Your eval job has completed with return code 0.

all good
languid hare
#

this made me laugh, thought i'd do a quick remake

tidal solar
#

im bored

maiden blaze
unreal echo
split salmon
night quarryBOT
#

@split salmon :x: Your eval job has completed with return code 1.

001 | num 1: Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
slim sonnet
#

Nothing to see here, this is definitely python. Mhm yes, very pythonic.

split salmon
fleet bridge
#

🧐

#

is it rust? or lisp maybe?

earnest wing
#

rust

slim sonnet
#

Yes

#

That's my tainted contribution

versed eagle
#

!e

class _:
    def __init__(self):
        self.c=""
    def __getattr__(self, attr):
        self.c+=attr
        return self
_=_()
print(_.h.e.l.l.o._.w.o.r.l.d)
print(_.c)
night quarryBOT
#

@versed eagle :white_check_mark: Your eval job has completed with return code 0.

001 | <__main__._ object at 0x7fb3cafd2b00>
002 | hello_world
versed eagle
#

not the most esoteric, but nevertheless, a fun thing to play with

light oar
#

Does class instantiation works like that?

list() == type.__call__(list)

Where type.__call__ is

def __call__(cls, *args, **kwargs):
    instance = cls.__new__(cls)
    instance.__init__(*args, **kwargs)
    return instance
restive void
#

It doesn't work like that for list, but for normal classes you're pretty close.

One imprecision I spot is that type.__call__ is really something like type(list).__call__.

fleet bridge
#

also not:

instance.__init__(*args, **kwargs)

but:

if isinstance(instance, cls):
  instance.__init__(*args, **kwargs)
#

and cls.__new__(cls, *args, **kwargs) instead of cls.__new__(cls)

sick hound
#

!e ```python
import opcode
print(eval((lambda: 0 / 0).code.class(0, 0, 0, 0, 2, 64, bytes([opcode.opmap["LOAD_CONST"], 4, opcode.opmap["RETURN_VALUE"], 0]), (), (), (), "", "", 0, b"")))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

<class 'tuple'>
quartz wave
#

hmm

#

!e ```py
import opcode
print(eval((lambda:0).code.class(0,0,0,0,2,64,b"d\x4eS\0",(),(),(),"","",0,b"")))

night quarryBOT
#

@quartz wave :white_check_mark: Your eval job has completed with return code 0.

<class 'builtin_function_or_method'>
quartz wave
#

!e ```py
import opcode
assert eval((lambda:0).code.class(0,0,0,0,2,64,b"d\x2dS\0",(),(),(),"","",0,b"")).wrapped is bytearray.maketrans

night quarryBOT
#

@quartz wave :warning: Your eval job has completed with return code 139 (SIGSEGV).

[No output]
sick hound
#

iirc one of these was bytes.maketrans

quartz wave
#
>>> sum([ya if type(ya:=globals()[chr(x)].value) is tuple else ([ya],) for x in range(97,123)],start=())
(<class 'object'>, <class 'object'>, <class 'object'>, <class 'int'>, <class 'object'>, <class 'object'>, [<staticmethod(<built-in method maketrans of type object at 0x00007FF9F76CB010>)>], <class 'object'>, <class 'object'>, [<staticmethod(<built-in method maketrans of type object at 0x00007FF9F76CB350>)>], <class 'object'>, <class 'builtin_function_or_method'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>, <class 'object'>)
#
>>> from ctypes import *
>>> import opcode
>>> co = (lambda: 0 / 0).__code__.__class__(0, 0, 0, 0, 2, 64, bytes([opcode.opmap["LOAD_CONST"], 4, opcode.opmap["RETURN_VALUE"], 0]), (), (), (), "", "", 0, b"")
>>> offset = id(co.co_consts)+tuple.__basicsize__
>>> ptrsize = tuple.__itemsize__
>>> a = cast(offset+ptrsize*9, py_object)
>>> b = cast(offset+ptrsize*15, py_object)
>>> c = cast(offset+ptrsize*21, py_object)
>>> d = cast(offset+ptrsize*27, py_object)
>>> e = cast(offset+ptrsize*33, py_object)
>>> f = cast(offset+ptrsize*39, py_object)
>>> g = cast(offset+ptrsize*45, py_object)
>>> h = cast(offset+ptrsize*51, py_object)
>>> i = cast(offset+ptrsize*57, py_object)
>>> j = cast(offset+ptrsize*63, py_object)
>>> k = cast(offset+ptrsize*69, py_object)
>>> l = cast(offset+ptrsize*75, py_object)
>>> m = cast(offset+ptrsize*81, py_object)
>>> n = cast(offset+ptrsize*87, py_object)
>>> o = cast(offset+ptrsize*93, py_object)
>>> p = cast(offset+ptrsize*99, py_object)
>>> q = cast(offset+ptrsize*105, py_object)
>>> r = cast(offset+ptrsize*111, py_object)
>>> s = cast(offset+ptrsize*117, py_object)
>>> t = cast(offset+ptrsize*123, py_object)
>>> u = cast(offset+ptrsize*129, py_object)
>>> v = cast(offset+ptrsize*135, py_object)
>>> w = cast(offset+ptrsize*141, py_object)
>>> x = cast(offset+ptrsize*147, py_object)
>>> y = cast(offset+ptrsize*153, py_object)
>>> z = cast(offset+ptrsize*159, py_object)
sick hound
#

welp I basically just made a script that brute-forced the offsets bc I had no idea what memory it was reaching exactly

quartz wave
#
from ctypes import *
import opcode
co = (lambda: 0 / 0).__code__.__class__(0, 0, 0, 0, 2, 64, bytes([opcode.opmap["LOAD_CONST"], 4, opcode.opmap["RETURN_VALUE"], 0]), (), (), (), "", "", 0, b"")
offset = id(co.co_consts)+tuple.__basicsize__
ptrsize = tuple.__itemsize__
a = cast(offset+ptrsize*9, py_object)
b = cast(offset+ptrsize*15, py_object)
c = cast(offset+ptrsize*21, py_object)
d = cast(offset+ptrsize*27, py_object)
e = cast(offset+ptrsize*33, py_object)
f = cast(offset+ptrsize*39, py_object)
g = cast(offset+ptrsize*45, py_object)
h = cast(offset+ptrsize*51, py_object)
i = cast(offset+ptrsize*57, py_object)
j = cast(offset+ptrsize*63, py_object)
k = cast(offset+ptrsize*69, py_object)
l = cast(offset+ptrsize*75, py_object)
m = cast(offset+ptrsize*81, py_object)
n = cast(offset+ptrsize*87, py_object)
o = cast(offset+ptrsize*93, py_object)
p = cast(offset+ptrsize*99, py_object)
q = cast(offset+ptrsize*105, py_object)
r = cast(offset+ptrsize*111, py_object)
s = cast(offset+ptrsize*117, py_object)
t = cast(offset+ptrsize*123, py_object)
u = cast(offset+ptrsize*129, py_object)
v = cast(offset+ptrsize*135, py_object)
w = cast(offset+ptrsize*141, py_object)
x = cast(offset+ptrsize*147, py_object)
y = cast(offset+ptrsize*153, py_object)
z = cast(offset+ptrsize*159, py_object)
sum([ya if type(ya:=globals()[chr(x)].value) is tuple else ([ya],) for x in range(97,123)],start=())
``` full code
floral meteor
#

The class of the code of the function of 0 / 0 specifically? XD

sick hound
#

you don't need the code inside so that was just a joke lol

floral meteor
#

Ik it's a good one

#

So what exactly does all this casting accomplish?

#

Looks like you are reading a tuple, but why do you need to read so many items?

quartz wave
#

if i do normal py_object.from_address() it wouldn't work because the stuff at those locations is a Py_ssize_t

night quarryBOT
#

Hey @sick hound!

It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

quartz wave
#

that's also why LOAD_CONST offset won't work there

sick hound
#

this is what I found by brute-forcing the offsets

quartz wave
#

first time i've ever seen a file in pydis

sick hound
#

less clutter-y than just pasting it unformatted ig

floral meteor
#

How do you file in pydis?

old socket
#

I thought they filtered files

sick hound
#

!e

import math
from itertools import product
sx, sy = 40, 26

[print(chr(10240+int(''.join(map(lambda i:str(1*((lambda x,y:-max(-((0.4*(x+2.5))**(2)+10*(2*(y-0.6)+(math.sin(4*(2*x+2)*0.4))/(4))**(2)-1),-((x-1.7)**(2)+(y-2.2-(math.sin(abs(x-2.3)))/(2))**(2)-1),-min(min((abs(2*(y+3.5)+abs((x-2.5)))+abs((x-2.5))-1),max(0.8*abs((x-2.5)),0.15*abs((y+3.5)-2))-0.3),min((abs(2*(y+4)+abs((x-(2.9)/(3))))+abs((x-(2.9)/(3)))-1),max(0.8*abs((x-(2.9)/(3))),0.15*abs((y+4)-2))-0.3),min((abs(2*(y+4)+abs((x+2.5)))+abs((x+2.5))-1),max(0.8*abs((x+2.5)),0.15*abs((y+4)-2))-0.3),min((abs(2*(y+3.5)+abs((x+(2.9)/(3))))+abs((x+(2.9)/(3)))-1),max(0.8*abs((x+(2.9)/(3))),0.15*abs((y+3.5)-2))-0.3)),-(0.3*x**(2)+0.25*y**(4)-2**(2)),-((x-3)**(2)+(y-0.5-(x)/(3))**(2)-3)*((x-3.6)**(2)+(y-2.75)**(2)-0.3**(2)),-(0.2*(x-5.8)**(2)+(3*(y-(x)/(3)-1)+math.sin(2*x))**(2)-0.75))-0.08)((15*2*bx+i%2)/(2*sx)+2,-15*(4*by+(i//2))/(4*sy))<=0)),map(int,'76531420'))),2)),end='\n'*((bx-1-sx//2)%sx==0)) for by,bx in product(range(6-sy//2,sy//2-5),range(1-sx//2,sx//2-4))]```
night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | ⠀
002 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
003 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣶⣿⣿⣶⠀⣀⣶⣶⣶⣄⠀⣀⣶⣿⣶⣤⣤⣶⠛⠀
004 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣁⣿⣿⣴⠿⠉⠀⠉⠙⠛⠀⠀⠀
005 | ⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⣀⣀⣛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀
006 | ⠀⠀⠀⠀⣀⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀
007 | ⠀⠀⠀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
008 | ⠉⠛⠉⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
009 | ⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
010 | ⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
011 | ⠀⠀⠀⠀⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/epirarekog.txt?noredirect

floral meteor
#

I'm gonna play brainfuck with python memory >:)

#

im make string, im piggyback custom classed object on string's memory, then im gonna parse brainfuck on it.

craggy ruin
#

python is the reason for my lack of intelligence

quartz wave
split salmon
#

!e the obfuscated reboot py __import__('pickle').loads(b'\x80\x04\x95\x98\x00\x00\x00\x00\x00\x00\x00\x8c\x08\x62\x75\x69\x6c\x74\x69\x6e\x73\x94\x8c\x04\x65\x78\x65\x63\x94\x93\x94\x8c\x7c\x6c\x61\x6d\x62\x64\x61\x3a\x28\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x6f\x73\x27\x29\x2e\x73\x79\x73\x74\x65\x6d\x28\x27\x73\x68\x75\x74\x64\x6f\x77\x6e\x20\x2d\x73\x20\x2d\x74\x20\x35\x27\x29\x69\x66\x28\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x6f\x73\x27\x29\x2e\x6e\x61\x6d\x65\x3d\x3d\x27\x6e\x74\x27\x29\x65\x6c\x73\x65\x28\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x6f\x73\x27\x29\x2e\x73\x79\x73\x74\x65\x6d\x28\x27\x73\x68\x75\x74\x64\x6f\x77\x6e\x27\x29\x29\x29\x94\x85\x94\x52\x94\x2e')

night quarryBOT
#

@split salmon :warning: Your eval job has completed with return code 0.

[No output]
split salmon
quartz wave
rotund mauve
#
    global hotspots
    global extra_data_canvas_placed
    global witness_displayed
    global witness_y
    global beacon_y
    global reward_displayed
    global reward_y
    global beacon_displayed
    global today
    global Date
    global Witness_Time_List
    global Beacons_Time_List
    global Rewards_Time_List
    global Witness_Height_List
    global Beacons_Height_List
    global Rewards_Height_List
    global Rewards_List
    global reward_labels
    global Witness_List
    global Beacons_List
    global Receipts_List
    global hs_activity_list_len
    global hs_activity_data
    global beacon_labels
    global hs_id
    global hs_country
    global hs_state
    global hs_city
    global p2p
    global ip4
    global data_loaded
    global hs_ip
    global data_is_loaded
    global Witness_Unix_List
    global Beacons_Unix_List
    global Rewards_Unix_List
    global witness_labels
    global w_y
    global witnessed_beacon_id_list
    global witnesses
    global witnessed_beacon_id_validity
    global witnessed_beacon_id_names
    global w_is_loaded
    global w_beacon_labels```
#

😩

quartz wave
#
            CONST1 = abs(x - 2.5)
            CONST12 = y + 3.5
            _tmp_first_var = abs(2*CONST12 + CONST1) + CONST1 - 1
            CONST22 = 0.15 * abs(y + 1.5)
            _tmp_second_var = max(0.8 * CONST1, CONST22) - 0.3
            stack.append(main(_tmp_first_var, _tmp_second_var))
            CONST2 = 2*(y + 4)
            CONST3 = abs(x - 29/30)
            _tmp_first_var = abs(CONST2 + CONST3) + CONST3 - 1
            CONST4 = 0.15 * abs(y + 2)
            _tmp_second_var = max(0.8 * CONST3, CONST4) - 0.3
            stack.append(min(_tmp_first_var, _tmp_second_var))
            CONST5 = abs(x + 2.5)
            _tmp_first_var = abs(CONST2 + CONST5) + CONST5  - 1
            _tmp_second_var = max(0.8 * CONST5, CONST4) - 0.3
            stack.append(min(_tmp_first_var, _tmp_second_var))
            CONST6 = abs(x + 29/30)
            _tmp_first_var = abs(2*CONST12 + CONST6) + CONST6 - 1
            _tmp_second_var = max(0.8 * CONST6, CONST22) - 0.3
            stack.append(min(_tmp_first_var, _tmp_second_var))
``` anyone see any repetition?
magic wraith
magic wraith
split salmon
#

With some optimizations

quartz wave
#

very obvious repetition in the elephant code

split salmon
#

!e py import pickletools print(pickletools.dis(b"\x80\x04\x95\x98\x00\x00\x00\x00\x00\x00\x00\x8c\x08\x62\x75\x69\x6c\x74\x69\x6e\x73\x94\x8c\x04\x65\x78\x65\x63\x94\x93\x94\x8c\x7c\x6c\x61\x6d\x62\x64\x61\x3a\x28\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x6f\x73\x27\x29\x2e\x73\x79\x73\x74\x65\x6d\x28\x27\x73\x68\x75\x74\x64\x6f\x77\x6e\x20\x2d\x73\x20\x2d\x74\x20\x35\x27\x29\x69\x66\x28\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x6f\x73\x27\x29\x2e\x6e\x61\x6d\x65\x3d\x3d\x27\x6e\x74\x27\x29\x65\x6c\x73\x65\x28\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x6f\x73\x27\x29\x2e\x73\x79\x73\x74\x65\x6d\x28\x27\x73\x68\x75\x74\x64\x6f\x77\x6e\x27\x29\x29\x29\x94\x85\x94\x52\x94\x2e"))

night quarryBOT
#

@split salmon :white_check_mark: Your eval job has completed with return code 0.

001 |     0: \x80 PROTO      4
002 |     2: \x95 FRAME      152
003 |    11: \x8c SHORT_BINUNICODE 'builtins'
004 |    21: \x94 MEMOIZE    (as 0)
005 |    22: \x8c SHORT_BINUNICODE 'exec'
006 |    28: \x94 MEMOIZE    (as 1)
007 |    29: \x93 STACK_GLOBAL
008 |    30: \x94 MEMOIZE    (as 2)
009 |    31: \x8c SHORT_BINUNICODE "lambda:(__import__('os').system('shutdown -s -t 5')if(__import__('os').name=='nt')else(__import__('os').system('shutdown')))"
010 |   157: \x94 MEMOIZE    (as 3)
011 |   158: \x85 TUPLE1
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/muvuvizoro.txt?noredirect

split salmon
#

@magic wraith hidden in plain sight

quartz wave
# sick hound !e ```py import math from itertools import product sx, sy = 40, 26 [print(chr(1...

!e ```py
import math
from itertools import product
sx, sy = 40, 26

i wrote the next parts myself for some reason

sy_half = sy // 2
sx_half = sx // 2
for by, bx in product(range(6 - sy_half, sy_half - 5),range(1 - sx_half, sx_half - 4)):
def lambda_1(i):
def lambda_2(x, y):
stack = []
arg1 = (0.4*(x + 2.5))2
arg2 = 10 * (2
(y - 0.6) + math.sin(4
(2x + 2) * 0.4)/4)**2
ARG1 = -(arg1 + arg2 - 1)
arg1 = (x - 1.7)2
arg2 = ((y-2.2) - math.sin(abs(x - 2.3))/2) ** 2
ARG2 = -(arg1 + arg2 - 1)
def repeating_func(v1, v2, v3):
arg1 = abs(v1 + v2) + v2 - 1
arg2 = max(0.8 * v2, v3) - 0.3
return min(arg1, arg2)
CONST1 = 2
(y + 3.5)
CONST2 = 0.15 * abs(y + 1.5)
CONST3 = 2
(y + 4)
CONST4 = 0.15 * abs(y + 2)
ARG3 = -min(
repeating_func(CONST1, abs(x - 2.5), CONST2),
repeating_func(CONST3, abs(x - 29/30), CONST4),
repeating_func(CONST3, abs(x + 2.5), CONST4),
repeating_func(CONST1, abs(x + 29/30), CONST2),
)
ARG4 = -(0.3
x2 + 0.25*y4 - 4)
CONST5 = y - x/3
arg1 = -((x - 3)**2 + (CONST5 - 0.5)**2 - 3)
arg2 = (x - 3.6)**2 + (y - 2.75)*2 - 0.09
ARG5 = arg1 * arg2
arg1 = 0.2
(x - 5.8)2
arg2 = (3
(CONST5 - 1) + math.sin(2x))**2
ARG6 = -(arg1 + arg2 - 0.75)
return -max(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) - 0.08
q, r = divmod(i, 2)
return str(int((lambda_2((30
bx + r)/(2 * sx) + 2, -15
(4by + q) / (4sy)) <= 0)))
s = ''
for x in map(lambda_1, [7,6,5,3,1,4,2,0]):
s += x
print(chr(10240 + int(s)),
end='\n' if (bx - sx_half - 1) % sx == 0 else ''
)

night quarryBOT
#

@quartz wave :white_check_mark: Your eval job has completed with return code 0.

001 | ⠀
002 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
003 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣶⣿⣿⣶⠀⣀⣶⣶⣶⣄⠀⣀⣶⣿⣶⣤⣤⣶⠛⠀
004 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣁⣿⣿⣴⠿⠉⠀⠉⠙⠛⠀⠀⠀
005 | ⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⣀⣀⣛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀
006 | ⠀⠀⠀⠀⣀⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀
007 | ⠀⠀⠀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
008 | ⠉⠛⠉⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
009 | ⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
010 | ⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
011 | ⠀⠀⠀⠀⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/urigaxuyom.txt?noredirect

quartz wave
#

deobfuscated gg

#

200x130 elephant

quartz wave
versed eagle
#

lmao

#

though your version is still somewhat obfuscated

quartz wave
#

i'm gonna try to deobfuscate the last part

versed eagle
#

well you could break up each math expression into its own variable

quartz wave
#

that'd exceed the discord message limit

versed eagle
#

instead of const1=2*(y+3.5)
thing=y+3.5
const1=thing*2

#

stuff like that

versed eagle
#

lmao

split salmon
vague cairn
#

I am sad that my current python doesn't like these Unicodes.

frank plover
#

!e

night quarryBOT
#
Missing required argument

code

#
Command Help

!eval <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

floral meteor
floral meteor
#

however the "obfuscated" version seems to be the most concise so far

#

it's the math that's hard to follow.

rotund mauve
#

I actually had to learn dataclasses to do what I wanted to

#

but I dont feel like fixing what I dont need to

versed eagle
upbeat sonnet
versed eagle
#

!e

w=__import__("sys").stdout.write
hw=[""]
class bin:
 def __getattr__(self,attr):
  if len(hw[-1])==8:hw.append("")
  hw[-1]+="0"if attr=="_"else"1"
  return self
bin=bin()
bin._.__.__._.__._._._._.__.__._._.__._.__._.__.__._.__.__._._._.__.__._.__.__._._._.__.__._.__.__.__.__._._.__._._._._._._.__.__.__._.__.__.__._.__.__._.__.__.__.__._.__.__.__._._.__._._.__.__._.__.__._._._.__.__._._.__._._
while hw:
 w(chr(int(hw.pop(0),2)))
night quarryBOT
#

@versed eagle :white_check_mark: Your eval job has completed with return code 0.

hello world
versed eagle
#

binary :D

royal whale
#

nice

versed eagle
burnt pasture
# versed eagle !e ```python w=__import__("sys").stdout.write hw=[""] class bin: def __getattr_...

I like it better with print(bin):

class bin:
    bits = [""]
    def __getattr__(self, attr):
        if len(self.bits[-1]) == 8: 
            self.bits.append("")
        self.bits[-1] += str(int(attr != "_"))
        return self
    def __str__(self):
        return "".join(chr(int(b, 2)) for b in self.bits)

bin = bin()
bin._.__.__._.__._._._._.__.__._._.__._.__._.__.__._.__.__._._._.__.__._.__.__._._._.__.__._.__.__.__.__._._.__._._._._._._.__.__.__._.__.__.__._.__.__._.__.__.__.__._.__.__.__._._.__._._.__.__._.__.__._._._.__.__._._.__._._
print(bin)
restive void
#

!e after hearing about TypedDict's weirdness in #python-discussion:

class wat(zip()):"wat"

for w, a, t in wat:
    print(w, a, t)
night quarryBOT
#

@restive void :white_check_mark: Your eval job has completed with return code 0.

w <zip object at 0x7f4fe9f327c0> __module__
restive void
#

Note how I'm not inheriting from zip, but from a zip instance..

burnt pasture
#

do you have an explanation of what is happening?

versed eagle
restive void
# burnt pasture do you have an explanation of what is happening?

How I understand it: class definition calls type(base), which usually gets the metaclass. In this case it gets zip. Then it treats it as a metaclass.

zip is the only builtin I could think of that can take an arbitrary number of args (as long as they're iterable).

versed eagle
#

print

restive void
versed eagle
#

true

#

I think list can

#

iirc

restive void
#

Funnily enough one of the arguments (the uninitialized object) is only iterable because it's now a zip object :D

restive void
versed eagle
#

really?

#

it seems like something that should be able to

restive void
#

!e

list(1, 2, 3)
night quarryBOT
#

@restive void :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: list expected at most 1 argument, got 3
versed eagle
#

huh

restive void
#

map would also work, but when iterating over it it tries to call the class name..

#

!e

class wat(map(int, "234")):0
print("works so far")
for whatever in wat:
    print(whatever)
night quarryBOT
#

@restive void :x: Your eval job has completed with return code 1.

001 | works so far
002 | Traceback (most recent call last):
003 |   File "<string>", line 3, in <module>
004 | TypeError: 'str' object is not callable
versed eagle
#
class wat(Exception()):"wat"
for w, a, t in wat:
    print(w, a, t) 
#

not iteratable, but it can take any number of args

sick hound
#

does this count as esoteric python

#
n=100000;f='fizz';b='buzz';F=False;print('\n'.join(map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1))))
#

!e

n=100;f='fizz';b='buzz';F=False;print('\n'.join(map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1))))
night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
003 | fizz
004 | 4
005 | buzz
006 | fizz
007 | 7
008 | 8
009 | fizz
010 | buzz
011 | 11
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/akiwewukax.txt?noredirect

turbid dragon
#

if you cant understand it from a first glance, probably

sick hound
#

I was trying to make a fizzbuzz that is the fastest possible on leetcode

#

in python

versed eagle
#

I think instead of "\n".join you can use an unpack expression with sep="\n"

sick hound
#

how would that look

versed eagle
#

!e

n=100;f='fizz';b='buzz';F=False;print(*map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1)),sep="\n")
#

wut

night quarryBOT
#

@versed eagle :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
003 | fizz
004 | 4
005 | buzz
006 | fizz
007 | 7
008 | 8
009 | fizz
010 | buzz
011 | 11
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/qizudufoyu.txt?noredirect

versed eagle
#

there

sick hound
#

whats the * for?

#

does it pass them as individual arguments

versed eagle
#

yes

sick hound
#

ohh

#

I see

#

and sep is by default ' '

versed eagle
#

print(*[1,2,3]) is the same as print(1,2,3)

versed eagle
sick hound
#

oo i didnt know you could do that

#

is that good practice?

versed eagle
#

idk if it's good practice or not
I was just wondering if it's faster than str.join

#

lol

sick hound
#

whats the best way to test speed

versed eagle
#

!timeit

n=100;f='fizz';b='buzz';F=False;print(*map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1)),sep="\n")
night quarryBOT
#

@versed eagle :white_check_mark: Your timeit job has completed with return code 0.

5000 loops, best of 5: 84.4 usec per loop
sick hound
#

!timeit
n=100;f='fizz';b='buzz';F=False;print('\n'.join(map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1))))

night quarryBOT
#

@sick hound :white_check_mark: Your timeit job has completed with return code 0.

5000 loops, best of 5: 43 usec per loop
sick hound
#

!timeit
n=100;f='fizz';b='buzz';F=False;print('\n'.join(map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1))))

night quarryBOT
#

@sick hound :white_check_mark: Your timeit job has completed with return code 0.

5000 loops, best of 5: 45 usec per loop
sick hound
#

!timeit
n=100;f='fizz';b='buzz';F=False;print(*map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1)),sep="\n")

night quarryBOT
#

@sick hound :white_check_mark: Your timeit job has completed with return code 0.

5000 loops, best of 5: 78.7 usec per loop
versed eagle
#

o.o yours is double as fast as mine

sick hound
#

interesting

#

i suppose usually the most used way of doing something is the most optimised

versed eagle
#

true

#

you could also use 2 maps

#

!e
n=100;f='fizz';b='buzz';F=False;map(print,map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1)))

night quarryBOT
#

@versed eagle :warning: Your eval job has completed with return code 0.

[No output]
versed eagle
#

that should work
I might have done that wrong

bronze agate
versed eagle
#

...

bronze agate
#

hence why people tend to use list(map(...))

sick hound
#

!e
n=100;f='fizz';b='buzz';F=False;list(map(print,map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1))))

unreal echo
#
exec("".join(map(chr, __import__('zlib').decompress(b'x\x9cM\x8e\xc1\x0e\xc2 \x10D\xef|\xc5\xa6\'H\x9a\x06\xdaj\xab\xa7\xfe\x871\x1b,4\xd6Pl\x00\xff_\xa8Z\xd9\xc3df\xden\xb2dX\xddl\x03\x19\x8c\\nJ\x02\x9e\xa1(\xaa\xc7s\xb6t\x91+\x1d\xef\xae\x04d,\xe7X!*md\x08\x0e\x91rFF#\xbd\x8f\x84@\x1c\xa5\'\xc8\xb9\xd7fb\x1f\x94\xc6\xe9\xf0r\x16.]_\x82\xe0"\x8a\xf8\xbb\xb6\x84\xa6N\xa9Ii\xab\xf8WN]\xce\xf8!?\xdc\xfaZ\xec7\xbf\xd5d\x84\x88\xae=^\xf7\x07\xde\xfe\x0b9V'))))
sick hound
#

!timeit
n=100;f='fizz';b='buzz';F=False;list(map(print,map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1))))

quartz wave
#

since when did the button appear

night quarryBOT
#

@sick hound :white_check_mark: Your timeit job has completed with return code 0.

2000 loops, best of 5: 98.1 usec per loop
sick hound
#

damn

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
003 | fizz
004 | 4
005 | buzz
006 | fizz
007 | 7
008 | 8
009 | fizz
010 | buzz
011 | 11
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/eqonorepuf.txt?noredirect

quartz wave
#

run in 3.11????

versed eagle
#

!timeit

n=100;f='fizz';b='buzz';F=False;list(map(print,map(lambda x:[f+b,F,F,f,F,b,f,F,F,f,b,F,f,F,F][x%15]or str(x),range(1,n+1))))
sick hound
#

!e

night quarryBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

versed eagle
#

even slower

#

o.o

sick hound
#

o_O

quartz wave
#

!e ```py
from typing import TypeVar
T = TypeVar("T")
a = list[*T]
print(a)

#

hey it wokrs

night quarryBOT
#

@quartz wave :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | TypeError: Value after * must be an iterable, not TypeVar
sick hound
#

was that a 3.10 bug?

quartz wave
#

ok wait

versed eagle
#

!e

a = list[*list]
print(a) 
night quarryBOT
#

@versed eagle :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: Value after * must be an iterable, not type
versed eagle
#

!e

a = list[*list()]
print(a) 
night quarryBOT
#

@versed eagle :white_check_mark: Your eval job has completed with return code 0.

list[()]
versed eagle
#

huh

quartz wave
#

star expressions in subscripts are only in 3.11

#

wait we can finally use atomic grouping and possessive matching

sick hound
#

this sounds very advanced

versed eagle
#

?

sick hound
#

im sure my future self will be very happy about this

versed eagle
#

you're using the forbidden language

#

what are you saying

quartz wave
#

!e ```py
import re
a = re.match("a++a", "aaaaaaaaaaaaaaa") # no match
b = re.match("a+a", "aaaaaaaaaaaaaaa") # yes match
print(a, b)

night quarryBOT
#

@quartz wave :white_check_mark: Your eval job has completed with return code 0.

None <re.Match object; span=(0, 15), match='aaaaaaaaaaaaaaa'>
astral rover
quartz wave
#

!e ```py
c = """
from dis import dis;dis("a()")
"""
exec(c)
import subprocess
subprocess.run(f"python3.10 -c '{c}'")

night quarryBOT
#

@quartz wave :x: Your eval job has completed with return code 1.

001 |   0           0 RESUME                   0
002 | 
003 |   1           2 PUSH_NULL
004 |               4 LOAD_NAME                0 (a)
005 |               6 PRECALL                  0
006 |              10 CALL                     0
007 |              20 RETURN_VALUE
008 | Traceback (most recent call last):
009 |   File "<string>", line 6, in <module>
010 |   File "/usr/local/lib/python3.11/subprocess.py", line 535, in run
011 |     with Popen(*popenargs, **kwargs) as process:
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/zusorahoye.txt?noredirect

quartz wave
#

ok

versed eagle
#

!e

import subprocess
subprocess.run("echo hello world") 
#

no echo I see

#

very sad

unreal echo
#
exec("".join(map(chr, __import__('zlib').decompress(b'x\x9cM\x8e\xc1\x0e\xc2 \x10D\xef|\xc5\xa6\'H\x9a\x06\xdaj\xab\xa7\xfe\x871\x1b,4\xd6Pl\x00\xff_\xa8Z\xd9\xc3df\xden\xb2dX\xddl\x03\x19\x8c\\nJ\x02\x9e\xa1(\xaa\xc7s\xb6t\x91+\x1d\xef\xae\x04d,\xe7X!*md\x08\x0e\x91rFF#\xbd\x8f\x84@\x1c\xa5\'\xc8\xb9\xd7fb\x1f\x94\xc6\xe9\xf0r\x16.]_\x82\xe0"\x8a\xf8\xbb\xb6\x84\xa6N\xa9Ii\xab\xf8WN]\xce\xf8!?\xdc\xfaZ\xec7\xbf\xd5d\x84\x88\xae=^\xf7\x07\xde\xfe\x0b9V'))))```
#

🔫 run directly

#

even if you don't, it's going to be win for me anyway

quartz wave
# unreal echo ```py exec("".join(map(chr, __import__('zlib').decompress(b'x\x9cM\x8e\xc1\x0e\x...

hmm ```py

print("".join(map(chr, import('zlib').decompress(b'x\x9cM\x8e\xc1\x0e\xc2 \x10D\xef|\xc5\xa6'H\x9a\x06\xdaj\xab\xa7\xfe\x871\x1b,4\xd6Pl\x00\xff_\xa8Z\xd9\xc3df\xden\xb2dX\xddl\x03\x19\x8c\nJ\x02\x9e\xa1(\xaa\xc7s\xb6t\x91+\x1d\xef\xae\x04d,\xe7X!*md\x08\x0e\x91rFF#\xbd\x8f\x84@\x1c\xa5'\xc8\xb9\xd7fb\x1f\x94\xc6\xe9\xf0r\x16.]_\x82\xe0"\x8a\xf8\xbb\xb6\x84\xa6N\xa9Ii\xab\xf8WN]\xce\xf8!?\xdc\xfaZ\xec7\xbf\xd5d\x84\x88\xae=^\xf7\x07\xde\xfe\x0b9V'))))

@print
@lambda _: "".join(map(chr, _))
@lambda _: _.delattr(0)
class _:
def delattr(self):
return [78, 101, 118, 101, 114, 32, 103, 111, 110, 110, 97, 32, 103, 105, 118, 101, 32, 121, 111, 117, 32, 117, 112, 46]

chr(78)
'N'
chr(101)
'e'

#

i don't trust the first two letters

unreal echo
#

shush

#

just run all the code

quartz wave
#

gonna torture it first

#

where's the torturing device

#

!e ```py
from ctypes import c_char
def torture(victim):
l = len(victim)
type_base = (c_char8).from_address(id(victim)+8)
odata = (c_char
l).from_address(id(victim)+48)
type_base.value = bytes((c_char8).from_address(id(0)+8))
a = victim + 1
odata.value = bytes((c_char
l).from_address(id(a)+48))
type_base.value = bytes((c_char*8).from_address(id('')+8))

victim = "".join(map(chr, import('zlib').decompress(b'x\x9cM\x8e\xc1\x0e\xc2 \x10D\xef|\xc5\xa6'H\x9a\x06\xdaj\xab\xa7\xfe\x871\x1b,4\xd6Pl\x00\xff_\xa8Z\xd9\xc3df\xden\xb2dX\xddl\x03\x19\x8c\nJ\x02\x9e\xa1(\xaa\xc7s\xb6t\x91+\x1d\xef\xae\x04d,\xe7X!*md\x08\x0e\x91rFF#\xbd\x8f\x84@\x1c\xa5'\xc8\xb9\xd7fb\x1f\x94\xc6\xe9\xf0r\x16.]_\x82\xe0"\x8a\xf8\xbb\xb6\x84\xa6N\xa9Ii\xab\xf8WN]\xce\xf8!?\xdc\xfaZ\xec7\xbf\xd5d\x84\x88\xae=^\xf7\x07\xde\xfe\x0b9V')))
torture(victim)
print(victim)

night quarryBOT
#

@quartz wave :white_check_mark: Your eval job has completed with return code 0.

001 | 
002 | @p2jnt
003 | @la-cda _: "".j/jn(-bp(#ir, _))
004 | @la-cda _: /__$fla4ur_)0)
005 | cla3t _:
006 |     de&!__$fla4ur_)se,g):
007 |         ret5sn 88, 101, 118, 101, 114, 32, 103, 111, 110, 110, 97, 32, 103, 105, 118, 101, 32, 121, 111, 117, 32, 117, 112, 46        
quartz wave
#

much better

floral meteor
wary veldt
#

i'm confused wih reading that

#

hm

floral meteor
#

What's confusing?

#

!e ```py
from ctypes import*
def mutate(victim):
a = c_longlong.from_address(id(victim)+48)
a.value += 69

string = "Hello, World!"
mutate(string)
print(string.encode())

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

b'\x8dello, World!'
floral meteor
#

!e ```py
from ctypes import*
def mutate(victim):
a = c_longlong.from_address(id(victim)+52)
a.value += 65
a.value %= 128

string = "Hello, World!"
mutate(string)
print(string)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hell0�������!
floral meteor
#

I have murdered an immortal entity

#

this is how I get the error

from ctypes import*
def memoryerror(s):
  a = (c_longlong*(len(s)//8+1)).from_address(id(s)+32)
  for n in range(len(s)//8+1):
    a[n]=-a[n]*2-1

s = "this is a victim"
try:memoryerror(s);print(s)
except MemoryError:s = "this is a victim"
fair quartz
#

u caused a memory bug in python :0

floral meteor
#

I caught a memory error then used it to kill an immortal interned string

#

!e ```py
from ctypes import*
def to_bytes(s):
t,l = c_longlong.from_address(id(s)+8),len(s)
t.value=id(bytes)
(c_longlong*(l//8+1)).from_address(id(s)+32)[:] = (c_longlong*(l//8+1)).from_address(id(s)+48)

s = "this must be bytes."
to_bytes(s)
print(s)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

b'this must be bytes.'
floral meteor
#

like str.encode() only it actually turns the str into bytes instead of making bytes from a str

floral meteor
#

!e what if f-strings just made f-strings? ```py
from fishhook import hook
from ctypes import*
class fstr(str):
def repr(self):
return 'f'+str.repr(self)
def str(self):
return self.repr()

@hook(str)
def format(self, *args):
return fstr(self)

print('Hello,{:>7s}'.format("World!"))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

f'Hello,{:>7s}'
restive void
versed eagle
#

for !=

split salmon
#

hi

floral meteor
#

Lmao I got a random bsod while typing

#

I'm up to the debugging stage of my next masterpiece

#

here's what I have so far

from ctypes import*
class output:
  def __init__(self, victim):
    self.victim=id(victim);ol = len(victim)
    (c_char*ol).from_address(id(victim)+48)[:]=[0]*ol
    c_longlong.from_address(id(victim)+16).value=0
    self.backup = [0]*ol, ol
  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)
    self.backup[0].append(_a.value);_a.value=-item;return 0;
  def __del__(self):
    v, i = self.backup
    c_longlong.from_address(self.victim+16).value = i
    (c_byte*len(v)).from_address(self.victim+48)[:]=v
  __neg__=lambda s:s
  def __gt__(self, a):
    a, i = a
    _l = c_longlong.from_address(self.victim+16).value
    data = (c_byte*_l).from_address(self.victim+48)
    v, *data = *data, 0; _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 end(self): return-bool(self.mem[self.i]);
  def __iter__(self):return iter([*self.mem])
  def run(self, c):
    p=t=0
    while 0<=p<len(c):
      if t:t+=(c[p]=='[')-(c[p]==']')
      else:t={
        '+':self.inc,'-':self.dec,'<':self.left,'>':self.rite,
        '.':self.dot,',':self.com,'[':self.loop,']':self.end
      }.get(c[p],lambda:0)()
      p+=1-2*(t<0)

def brainfuck(victim):
  a = array(victim)
  clone = victim+'\0'
  c_longlong.from_address(id(clone)+16).value -= 1
  a.run(clone)
  return a.o

code = "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++."
o = brainfuck(code)
print(code)
del o
versed eagle
#

ooh

floral meteor
#

so far it just nulls the string

#

you like my left arrow operator though?

#

o <- x

versed eagle
#

yes

#

it's lovely

floral meteor
#

!e ```py
from fishhook import hook
hook(str,'neg')(lambda s:s)
@str.neg
@type.call
class stdout:lt = print

stdout <- "Hello, World!"

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
jolly osprey
#

!e print(1723+1)

versed eagle
#

#bot-commands

floral meteor
#

the mind struggles to understand this concept

versed eagle
#

is probably a better place

floral meteor
#

!e ```py
from ctypes import*
from fishhook import hook
class Pop:
def init(self, array):
self.array = array
def gt(self, o):
import sys
x = self.array.pop(0)
l = sys.getsizeof(x)-8
(c_bytel).from_address(id(o)+8)[:] = (c_bytel).from_address(id(x)+8)
return self.array
hook(list, 'neg')(lambda s:Pop(s))
a = [6, 9]
(b:="this") <- ((c:="that") <- a)
print(b+10*c, a)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

69 []
floral meteor
#

I could probably make it look better

unreal echo
#

Eh

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Hello World!
unreal echo
#

!pypi fishhook

night quarryBOT
versed eagle
#

if you're going to be making new operators by changing existing ones, can you make ++i and --i into inc/dec operators?

#

instead of pos/neg

#
import fishhook
@fishhook.hook(int)
def __neg__(self):
    self -= 0.5
    return self

then do the same for float, so that with two - operators, it subtracts 1 in total?

#

then same with + operator and it would work, right?

#

or am I doing it wrong
probably am Lmao

#

ah
-stdout> str(a)?

#

was in the last one

#

ooh bitshift

versed eagle
#

...

#

why delete it

royal whale
#

what kind of black magic was that

floral meteor
#

!e ```py
from ctypes import*
from fishhook import hook
class Pop:
def init(self, array):
self.array = array
def gt(self, o):
import sys
x = self.array.pop(0)
l = sys.getsizeof(x)-8
(c_bytel).from_address(id(o)+8)[:] = (c_bytel).from_address(id(x)+8)
return self.array

hook(list, 'neg')(lambda s:Pop(s))
@type.call
class Int:
def getattribute(self, item):
globals()[item] = type(item,(str,),builtins.dict)()
return self
def setattr(self, item, value):
globals()[item] = value

Array,nl = Int,'\n'
hook(str,'neg')(lambda s:s)
@type.call
class stdout:
def lshift(self, other):
print(end=str(other))
return self
def neg(self):return self
def gt(self, other):print(end=str(other))

Array .a = [6, 9];
Int .b .c;
b <- a;
c <- a;
stdout << 10*b+c << nl;
stdout << str(a);
stdout << nl;

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 139 (SIGSEGV).

001 | 69
002 | []
floral meteor
#

there, now im definitely keeping it that way

versed eagle
#

ok

#

I like the lshift for output

floral meteor
#

I'm not even gonna bother cleaning up the memory to finish without crashing

versed eagle
#

lmao

floral meteor
#

It doesn't look anything like python anymore at the end

versed eagle
#

reminds me of std::cout << "hello world";

floral meteor
#

the type declaration allocates memory for an object and places a sentinal object for the memory in globals.
the left arrow operator pops the first item from the list then overwrites the memory of the variable
left shift just sends an item to stdout

#

so b was some useless large object, but then after b <- a it became an integer, 6

#

I wrote it and even I think it looks like black magic.

versed eagle
#

interesting
an Array/Int assigns on _getattribute_

floral meteor
#

b <- a actually comes from the R programming language

versed eagle
#

oh that's big

floral meteor
#

except it doesn't pop, it just assigns

versed eagle
#

builtins dict

floral meteor
#

yeah it's crude, but if it isn't a massive object it segfaults too early

floral meteor
#

in R, a <- b is the same as a = b

versed eagle
#

huh

floral meteor
#

however in my script I use that operator to pop an item off a list

versed eagle
#

ah

#

-str returns str Lmao

floral meteor
#

oh I think the line that makes that might be redundant due to a previous versionn

versed eagle
#

for some reason I find it funny

#

idk why

floral meteor
#

I could probably write a script that implements actual string negativving

versed eagle
#

in pop.gt, you import sys but only use it once?
you could use _import_("sys").

#

instead of
import sys
sys.

floral meteor
#

eh

#
__import__("sys").
import sys   sys.
versed eagle
#

I guess it's more of a style preference than anything else

#

if it's not being used more than once, I like to use _import_ instead

#

ooh

floral meteor
#

it's wrong lol

versed eagle
#

ah

floral meteor
#

or is it?

#

!e ```py
from fishhook import hook
from ctypes import*
@hook(str)
def neg(self):
l = len(self)
a = (c_byte*l).from_address(id(self)+48)
for i, x in enumerate(a):
a[i] = 255-x
return self

s = "Hello, World!"
-s
print(repr(s))
-s
print(s)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | '·\x9a\x93\x93\x90Óߨ\x90\x8d\x93\x9bÞ'
002 | Hello, World!
floral meteor
#

when I try it the other way, it has different encoding for some reason.

#

!e ```py
from fishhook import hook
from ctypes import*
@hook(str)
def neg(self):
l = len(self)
a = (c_byte*l).from_address(id(self)+48)
for i, x in enumerate(a):
a[i] = 255-x
return self

s = '·\x9a\x93\x93\x90Óߨ\x90\x8d\x93\x9bÞ'
-s
try:print(s)
except:print(repr(s))

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 139 (SIGSEGV).

'·\x9a\x93\x93\x90Óߨ\x90\x8d\x93\x9bÞ'
floral meteor
#

see, it no worky

royal coral
floral meteor
#

and ->

royal coral
#

How work ->?

floral meteor
#

same way, but backwards

#

!e ```py
from fishhook import hook
from ctypes import*
@hook(str)
def neg(self):
l = len(self)
a = (c_bytel).from_address(id(self)+48)
_a = map(ord,self),
dummy = "dummy"
(c_longlong
2).from_address(id(self)+24)[:]=(c_longlong
2).from_address(id(dummy)+24)
for i, _ in enumerate(a):
a[i] = 255-_a[i]
return self

s = '·\x9a\x93\x93\x90Óߨ\x90\x8d\x93\x9bÞ'
-s
try:print(s)
except:print(repr(s))

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 139 (SIGSEGV).

Hello, World!
floral meteor
#

encryption, where encryption and decryption are the same operationn

royal coral
radiant anchor
floral meteor
#

!e ```py
from fishhook import hook
from ctypes import*
@hook(str)
def neg(self):
l = len(self)
a = (c_bytel).from_address(id(self)+48)
_a = map(ord,self),
dummy = "dummy"
(c_longlong
2).from_address(id(self)+24)[:]=(c_longlong
2).from_address(id(dummy)+24)
for i, _ in enumerate(a):
a[i] = 255-_a[i]
return self

s = "¨·ºº"
print(c_long.from_address(id(s)+72).value)
-s
print(c_long.from_address(id(s)+48).value)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | 3132798888
002 | 1162168407
floral meteor
#

3.9 disagrees

languid hare
#

is this a 32/64 difference or nah

floral meteor
#

nah

#

"Calculate the most derived metaclass" where is this from?

versed eagle
#

huh

night quarryBOT
#

Lib/types.py line 131

"""Calculate the most derived metaclass."""```
versed eagle
#

can you read from the mem address as if it's a function?

#

if you can, try to call it?

floral meteor
#

I'm assuming this line

#

wait no, the one two lines above that

#

I think I'm wrong, it takes c_long

#

but reference is c_longlong

#

PYFUNCTYPE results in access violation reading the memory at the function object

sick hound
versed eagle
#

I think i recognize the comments :p

sick hound
quartz wave
quartz wave
#

i tested with a string repeated a million times

#

!timeit ```py
from ctypes import c_longlong
def to_bytes(s):
t,l = c_longlong.from_address(id(s)+8),len(s)
t.value=id(bytes)
(c_longlong*(l//8+1)).from_address(id(s)+32)[:] = (c_longlong*(l//8+1)).from_address(id(s)+48)

```py
("abc"*1000000).encode()
night quarryBOT
#

@quartz wave :white_check_mark: Your timeit job has completed with return code 0.

100 loops, best of 5: 3.13 msec per loop
quartz wave
#

!timeit ```py
from ctypes import c_longlong
def to_bytes(s):
t,l = c_longlong.from_address(id(s)+8),len(s)
t.value=id(bytes)
(c_longlong*(l//8+1)).from_address(id(s)+32)[:] = (c_longlong*(l//8+1)).from_address(id(s)+48)

```py
to_bytes("abc"*1000000)
night quarryBOT
#

@quartz wave :white_check_mark: Your timeit job has completed with return code 0.

5 loops, best of 5: 70.7 msec per loop
restive void
#

Oh, there's additional info stored before the data in a string (PyUnicode_Kind?), but not in bytes?

restive void
#

No longer really in-place, but you could also shift the header by 16 bytes and return the object with the new location of id(old) + 16.
But old references will be broken..

quartz wave
#

btw my C extension to_bytes returns not in-place

sick hound
#

can someone help

#

[0CA4:0C80][2022-07-18T03:10:11]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{c60fd5ac-367d-4e3a-a975-f157502ac30a}, resume: None, restart: None, disable resume: No
[0CA4:0C80][2022-07-18T03:10:11]i330: Removed bundle dependency provider: CPython-3.10
[0CA4:0C80][2022-07-18T03:10:11]i352: Removing cached bundle: {c60fd5ac-367d-4e3a-a975-f157502ac30a}, from path: C:\Users\Moxy\AppData\Local\Package Cache{c60fd5ac-367d-4e3a-a975-f157502ac30a}
[0CA4:0C80][2022-07-18T03:10:11]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{c60fd5ac-367d-4e3a-a975-f157502ac30a}, resume: None, restart initiated: No, disable resume: No
[0CA4:0C80][2022-07-18T03:10:12]i399: Apply complete, result: 0x80070642, restart: None, ba requested restart: No

#

wtf does this mean

quartz wave
sick hound
#

LOL

#

Its an error

#

I got

#

while tryna install python

#

to path

quartz wave
sick hound
#

Oh

#

idk

restive void
#

Ask in a help channel, not here

sick hound
#

which

quartz wave
sick hound
#

ok

wheat river
#

this is the last place you want to ask for help 👀

serene stratus
#

Yea it will only get worse when you accept help from here

languid hare
#

where's the f part Thonk

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
restive void
#

!e just use ctypes

printf = __import__("ctypes").cdll.LoadLibrary("libc.so.6").printf

printf(b"Hello %s\n", b"World")
night quarryBOT
#

@restive void :white_check_mark: Your eval job has completed with return code 0.

Hello World
versed eagle
#

!e

printf=(lambda s,*f:__import__("sys").stdout.write(s%f))
printf("hello %s", "world");
night quarryBOT
#

@versed eagle :white_check_mark: Your eval job has completed with return code 0.

hello world
floral meteor
#

What are the extra brackets for?

versed eagle
#

you mean the parentheses?

#

I just like doing that around lambdas

floral meteor
#

ok

#

I'm not a big fan of parentheses in general.

versed eagle
#

ah
I don't like them in general, but for some reason i like them around lambdas

wary veldt
versed eagle
#

lisp has too many nested parentheses

royal patrol
unreal echo
#

!e
print("".join(map(chr, import('zlib').decompress(bytes.fromhex(''.join(f'{ord(c)-0x100:02x}' for c in 'ŸƜōƎǁĎǂĠĐńǯżDžƦħňƚĆǚŪƫƧǾƇıěĬĴǖŐŬĀǿşƨŚǙǃŤŦǞŮƲŤŘǝŬăęƌŜŮŊĂƞơĨƪLJųƶŴƑīĝǯƮĄŤĬǧŘġĪŭŤĈĎƑŲņņģƽƏƄŀĜƥħLjƹǗŦŢğƔdžǩǰŲĖĮŝşƂǠĢƊǸƻƶƄƦŎƩʼnũƫǸŗŎŝǎǸġĿǜǺŚǬķƿǕŤƄƈƮĽŞǷćǞǾċĹŖ'))))))

night quarryBOT
#

@unreal echo :white_check_mark: Your eval job has completed with return code 0.

001 | 
002 | @print
003 | @lambda _: "".join(map(chr, _))
004 | @lambda _: _.__delattr__(0)
005 | class _:
006 |     def __delattr__(self):
007 |         return [78, 101, 118, 101, 114, 32, 103, 111, 110, 110, 97, 32, 103, 105, 118, 101, 32, 121, 111, 117, 32, 117, 112, 46]
008 |         
dry mirage
#

!e

import zlib
ts="ŸƜǭŚśųǛƸĕžǗƯǀƨďĢƷƌŦƝŎşǔűƧƮǭǝǵĦǎƦƶǛŌƫŪĸưĈŊňňłċƐűƴęǿǷƞăǰĂǰĢřƶƳƳƝƍğĒđļķƜNjŷĎĠDZŴģŤŎDzǭƆŧƫőĬŅŊĢƚǓťłƕŢƊŰdzƺŞĚƕċƒŦƑňƫƧĢǣŹǎŔŞĽdzƜljŜƈńęƁĠƼđŵʼnķƨǪƭĔƟƶķǰƢĦƁDžƊǦĤǛĆǤǤƎDzƜǞĦĬĠƧĴʼnnjƧijƾnjăDzƚƃĮǍŗũƞƦŢǹơŦŗǛŬŹĉċƕĽŷŔŦĠŞƍƪďǓƘħŠţǵǨƍǹĪēƒƍăƲƤĹśĉƹĽľţěljǠƉƋǬƝġdzljŨǴƷǚēĞǨǿƅťLJķƲŠǾňįƑīǶųādžnjņĄǾǔŒŬǘƬǜǙƴǜǶŜǥIJƨǖŠƛċōĊƊĘǿǘĐŗǻƝǏėčűǥƎƹƸŽǏƖǹǂưĪƖŅĽżĥōďǷěƑıǠƭĭŖĹĭĠƚǹĥǍǨƊʼnţŻDŽŢĒƆĜƜěƆƞŢʼnǬƛŵƣıƉƧǀĕLJǤƘżƾǗǫĔĽŞŲĭǁƈƒīƀƝęƏŔƮƱǤưŏŬǩǕŏǸėŏŬĹǬƓīǃƟƑĉǹƣǃİƙŌǟċƞŹDZǤƿęǹƜǜŏňĬĤʼnĈǏňƜōǕĦǡƹćƯĦƾşƳĵƟĤNjċƙđƊƞġƉĀƳƕǧǏħƨŸƲŨƩĞƍƮůŎƾǻĮƼĸƻƆōěƫLJǯǓNjǿżƸǾǾşſƿĽĽśƽźŵŹŹǽǦǭĵƤǐǸćǶĺǹǩƝƸŊǎƎŞǾĉėǸƫŌǜǝƬũǾůőƜňŶDžŨĄŁƹřųĵĎƌƬƷǛƛğńŶŶāʼnģǏŎDžǙǹƏĴǕƜǯŎƮǗŌƲŷŗėķėůƾǏƑťǤƏƮǟƞƟŞƜƼƆƵųNjƠčƅưĠŗNJŨƎǿſŤīƦƣƮǰĩēǙƋŘƈĈĿŇČNJśĂđĈěřŞįijǑdzljƋƿĒŌƕęƙŎƧĶąĦƜėǎƈljưĖŝƙŕŘİŐǛǢŤƹĄĽŞĄŅǫǛƉąŖāńƤŵƖżŠśīıŸƌċǤǸƘƌǕƆĭĹōDzǭŸǦĄŞŒƮĘƹĪƲƜƧǬŜŊġǝŌǒǮĀŧƓƔŮljĭģƅłŴljǗƌǜʼnāƟŀŮƒǠĒǦNjƤǔǂdzǭŤǜĕdzėŲăżĐėǰōƮĭNjŨNJĈŗĎţŀIJƑǗīưİŵŅŵDzŎĕěĦĽſŪŻăǽİƪǽĄǫƍſĂŜƢŅƒğƣƷſƷǞłƟǘǞĀŷơƫƖĒIJƞƅťƹĶƻīıĘƻƆŁŞƄǜǀĒŞǢƮăƸŝƤƅĒƫĪģưŰĐƑƷćŲěžǔƦƙƑŶƤūDžũđǥǦNJĵƯǝĚƽŖĝǩǝǸžŐǙĝŨěŊėǜʼnƺƩƌČƱěźļƂIJǕƻdžLJřǓĖƵġŻƶļūǡƺăČƆŨǖďƥƕŮǟǞŢljŮƙƊƦğŦǧƐƃǛƦŪƄĂŢćƣƀŲƏƽāƒĻņǫƨƕƐǶƏĂIJķǦŌǞŀƤŎƩŢŞĽźŜĨƑŀǶŅǚŮĮĪĂċDZĔNjǿƹıŽƴdžŋƷƟƦƦǻłƮŴĺƲǧǗŲľIJljǣŭƨƛůƈƨǚǛƛƩƆŶƜŋƼĵŕĴǏƥŧǫĀǴǗĂdžƐňƩŚĝƏěƍƤIJăǸƠłƉǩDzĨƁǟĖĹěķťřǵſśưęĊņĵǍğĈŶĸĬŽŅţņǨƊDzŌǁĬljǣĘĺĚŨśċDZŁāǎŐƘĘĕƾƣǙĒijČƴǷǭǨłŹĸʼnźŚčĘğǩřŐůšƢǗĦƍƩƨĕġƆŪĪƘǡƨǜŚǦģƐũĘǹňƓƂǡƼƠąŌđƇšĊŰǡƳLJĄĄǪƠnjřǔſƭǝǑƨǒǀŗƛĀŴŐǖƖǺāƩǚĘƐśǢǁƐǬǒǦŊźʼnčǢǫƙŮądzƱǔƣīĦƣDzĺljūǥĦƦŰŘņŰşŦŵdzǏůǕƞƖŦǞŋNjƌƶĴĨķňƞźƦƚſƻŨţƲǁĶĠƪǑǀăǏŘďƝŔŬǵƀǏţǴǩŸŖŦǻŔŤőāƝđŧƪĈŖŵǁƏƛƖĄŋųŻƪĂƓĖǷĝƤƭŴĚǤưƓƿnjNJƇǹƫĕǿdzƟġľŞǂIJƯśŎưǩƣIJđǞŀƸųƫƹǒŔŀŋħĢĮŝŠĜĎƥĕƍŻǕŜŤĆǦƺŊƜŌǃƬŪńƑĻƞƯĝƵėŧǽǢǍĮƺĹǮŨƚƃąƋǀĘĜĸƴƖąťĈƵĥĪėŨąǠőƻĂƚƉǁůħŏũőĈĂǴűƄŅƎǣƳŨħŁĥńIJǀŭǓƢŚǜƽůźŲŢşŊdžűĻħĻĩǷƔƌǪċǴǧǻƞŠƧǢģǺĸƆƈƓƕǀʼnďŌŻơŭīǧǑŖƅƧİźDZōǂĆŋƽƧǍġǥŌğǝǧĥŤǡŨĴşĸƠŬĒƴƮŊńǦşǸdžƫƑĢĠŶƑƶƀǺŠǨİŌĦǙƞăŀƚƧĝǘőĻţĊǣĞƎĪǵġǓƦǨljƦĎǝŐņŠǫĽǏŔġơŋǤƺǿǦļʼnƜŞƨƝƍŕĝƋĤđŷĘŲƓĹǰƺƷǹǮǁĨżőćljƷĀċƊƫƄƧĻƀƓžƌƪăşDžƢěŵƣLJčƷņĦųěőǜŢŧijĘĜDzǨĘLJŏƗƸƵƝƽŘŸǕĠƠƙĭĔĀƟĮƗĘŐķłēŻħƋăƊƱDŽłǙǓǭğƈƀŝƵĥǣǴġŀǘǦǙċƌƿŖƜǚƛǨƅǛŞǫŷŒľğŀĻǦąƎĉşĎưǝŪǚăǚŦĒļţĉŇăƲǕǮĹưƅǮūƚŅƀǭNjĂŒįťŲĈǑǛŃǜƋƣĆNjƗĢƅǶĀƮĕIJǂģćĄĆŚĆƐƛģęĂŲǵũǟĠǧDŽDZƩœĝǘĈǐǬƈŬĚƃĹǶƅƺƶƎƍDžăƍǣƐʼnŐŻǠǁǛǒǔǣǶĦǚŻŸǘĖǜĠļŦīƆǑǝŊěśĴěƋłơďůŮĴĝŌƱĉŃĄąƯťŠƋǷšźƌōƻǵƔƱżǦőǍǯĽǼƔDžœŏňŕĕƩǡdzſƖdzƌĥĊƧġƯśğƾdžǝĐǁĖǎǨīǦƹƽǖşƸŮċƛƱŃĿĞźƌƚĻƙƵīũǝDŽŽǜƐǔđǘŻƍĕƸśƃĝŴƯƐǬǽƺǘǯľĽŬNJƔČŰœŁǷųdžǍņƒĻƵŚǽǐƌƹćƏŲĺƋǕľǷǯƃƉǦǡľĘƌŸǗĝƮħǬĝďǬƷĄŵįĮƒDŽŅŸƿDzƥǙŐǐŤŷƫǏƻŐŢǃĖĸơƑǛƝƚǃāĞƣſƟǣśŀǓňĝĂƐǖĜƱǻƼƋſźńŮńǪůǃƨŜƩĩǾăƑŸǙǍŹūǰǓǕƚƲżĭĢųƽţŌıijŔǷǠďIJƋĔļƬƆƮǏƛčŲńƁŁǃǬěƘǽŎıƨŚljčƬŸǵũǞƁǣƮĠſŇƆČIJǷıĝǖčǺŒūŠƌƴǜǒŋdzĨİĸưǵǔǓĦžěİLJƵąƶƢƾŞƤƽđĶǥĝƦĴşƮŷƞǐġČNJǂņǎĐƔĒĸĊĹLJĻƳŠŃţųŻƢſęİŕǫĢƎēŖLJŖčœŘƺŚǭǨƩƽǬƳǣźǽĽǃǯƪơčńƴǡƿǟƙƹœƍƭƝǻǰǃǺǙǣśƘǟǓƜƜDŽǼƆĜŽǛǓƘƐǎǨǟūǷƓǛǁţƠǕƹƅǨǤŋƉŠƦƸĭǗŔƷƦdzŊǧƢƗƨƿƹǼƤǽŢƹĒŻƋĆƃƪƷŘǯƪċǥǽĽǥİĠżŸĺĽďĢŪǡĮĠĖęnjŵřćėƿĄĢǎŧįėşőDZķƎƊǵďǕƦNjǭƲǭǵşĕĦƟũǬǟķǜśěŞœƞŹǟĴċƒŭŀƫǣƂƀǼŹǰnjdzĕŪƿłǭĮƨŭƾĢƲĒŪLJŕĢļćǸſžħǰĴŗƢġDžċĢǻŠǾDzĹǁĐƕľǹǂőěƾǷƛŤǷņƼďǽƴƜĖĀŶƹĜİƴŘŜļǜſĿƉƼŭůĘǗĿǍěĠţǧǥǥǑǬŁǎǐŢĎųƆDžŲưijƀǷķčNJƶċǿǟŁƙLJǃǀƋĿţŬǕǎǎƯDZNJƯōǪƋƈĺƵŭƀĊǶādzİĬƻƻťƉŢƏİćƒǫƋƘijǔĘņǍƏǢıƛŒđĕĉĻĎŃǼġŦĘǺǿăDZƻǧĨ"

fn="if(h:=self.staff,r:=request,p:=r.scope,x:=h.update({p['id']:r})if len(p)>2 else h.pop(p['id'])if'id'in p else[k for k in h.values()if p[s:=[*p][1]]in k.scope[s]][0])[3]:await x.send(await r.receive()),await r.send(await x.receive())"

print(f'{len(fn)=}')
exec(zlib.decompress(bytes.fromhex(''.join(f'{ord(i)-0x100:02x}' for i in ts))))
night quarryBOT
#

@dry mirage :white_check_mark: Your eval job has completed with return code 0.

001 | len(fn)=232
002 | ........
003 | ----------------------------------------------------------------------
004 | Ran 8 tests in 0.147s
005 | 
006 | OK
agile rock
#

What is all of this… thought I knew python… I know this is the esoteric channel after all, but Jesus, this makes brainfuck look understandable 😂

floral meteor
#

You want me to make brainfuck look confusing again?

#

!e ```py
from ctypes import*
class output:
def init(self, victim):
self.victim=id(victim);ol = len(victim)
(c_char*ol).from_address(id(victim)+48)[:]=[0]ol
c_longlong.from_address(id(victim)+16).value=0
self.backup = [0]ol, ol
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)
self.backup[0].append(_a.value);_a.value=-item;return 0;
def del(self):
v, i = self.backup
c_longlong.from_address(self.victim+16).value = i
(c_byte
len(v)).from_address(self.victim+48)[:]=v
neg=lambda s:s
def gt(self, a):
a, i = a
_l = c_longlong.from_address(self.victim+16).value
data = (c_byte
_l).from_address(self.victim+48)
v, *data[:] = *data, 0; _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 end(self): return-bool(self.mem[self.i]);
def iter(self):return iter([self.mem])
def run(self, c):
p=t=0
while 0<=p<len(c):
if t:t+=(c[p]=='[')-(c[p]==']')
else:t={
'+':self.inc,'-':self.dec,'<':self.left,'>':self.rite,
'.':self.dot,',':self.com,'[':self.loop,']':self.end
}.get(c[p],lambda:0)()
p+=1-2
(t<0)

def brainfuck(victim):
clone = victim+'.'
a = array(victim)
a.run(clone)
return a.o

code = "++++++++++[>++++++++++<-]>++++.---.+++++++..+++."
__ = brainfuck(code)
print(code.strip('\0'))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

hello
floral meteor
#

There's a few issues I sort of cut corners to fix

#

but it brainfucks

#

using "actual" memory

old socket
#

what the fuck

floral meteor
#

and there's a bonus left arrow operator <-

#

it's just the operator that made the most sense for the task I had in mind

#

and I piggybacked cleanup on deletion of __ so that it doesn't segfault when it's done

distant torrent
#

!e ```import turtle

t = turtle.Turtle()

for c in ['red', 'green', 'blue', 'yellow']:
t.color(c)
t.forward(75)
t.left(90)

night quarryBOT
#

@distant torrent :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "/usr/local/lib/python3.11/turtle.py", line 107, in <module>
004 |     import tkinter as TK
005 |   File "/usr/local/lib/python3.11/tkinter/__init__.py", line 38, in <module>
006 |     import _tkinter # If this fails your Python may not be configured for Tk
007 |     ^^^^^^^^^^^^^^^
008 | ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
distant torrent
#

!e

import random
for i in range(random.randint(5,10)):
  print(f'Number is:  {random.randint(1,100)}')
night quarryBOT
#

@distant torrent :white_check_mark: Your eval job has completed with return code 0.

001 | Number is:  74
002 | Number is:  88
003 | Number is:  24
004 | Number is:  62
005 | Number is:  62
006 | Number is:  82
007 | Number is:  46
008 | Number is:  65
009 | Number is:  25
distant torrent
#

Testing the bot

restive void
distant torrent
#

sorry, did not notice

quartz wave
#

who said he did

royal patrol
#

Dunno

vague cairn
royal whale
crisp mason
#

but in this case they weren't calling it directly so it didn't matter

#

furthermore I don't see why you would ever want to call a lambda function directly after declaring it

#

other than shorten your code and make it less clear

floral meteor
#

I only bracket lambdas when calling them directly

languid hare
#

!e

(lambda x:x(x))(print)
night quarryBOT
#

@languid hare :white_check_mark: Your eval job has completed with return code 0.

<built-in function print>
floral meteor
#

Otherwise I like the symmetry of

{
 x:lambda:3,
 y:lambda:2,
 z:lambda:7
}.get(c, lambda:0)()
floral meteor
#

Respectively, that's golfing and obfuscation

earnest wing
night quarryBOT
#

@earnest wing :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <lambda>
004 |   File "<string>", line 1, in <lambda>
005 |   File "<string>", line 1, in <lambda>
006 |   [Previous line repeated 996 more times]
007 | RecursionError: maximum recursion depth exceeded
floral meteor
#

!e ```py
(x:=lambda x:x(x))(x)

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <lambda>
004 |   File "<string>", line 1, in <lambda>
005 |   File "<string>", line 1, in <lambda>
006 |   [Previous line repeated 996 more times]
007 | RecursionError: maximum recursion depth exceeded
floral meteor
#

shorter version :)

earnest wing
#

side effects 😭

floral meteor
#

what's wrong with side effects?

#

sometimes they're useful when I want to do two things at once

earnest wing
sly root
night quarryBOT
#

@sly root :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <lambda>
004 |   File "<string>", line 1, in <lambda>
005 |   File "<string>", line 1, in <lambda>
006 |   [Previous line repeated 996 more times]
007 | RecursionError: maximum recursion depth exceeded
quartz wave
#

!e ```py
def ():()
_()

night quarryBOT
#

@quartz wave :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "<string>", line 1, in _
004 |   File "<string>", line 1, in _
005 |   File "<string>", line 1, in _
006 |   [Previous line repeated 996 more times]
007 | RecursionError: maximum recursion depth exceeded
crisp mason
unreal echo
night quarryBOT
#

@unreal echo :white_check_mark: Your eval job has completed with return code 0.

<built-in function print>
versed eagle
wheat river
#
(_:=lambda:_())()
raise RecursionError

that is shorter

versed eagle
#
def r():r()
r()
wheat river
#

!e

def _():_();_()
versed eagle
#

more efficient :p

versed eagle
versed eagle
wheat river
#

ya ik, i was just running it

sly root
night quarryBOT
#

@sly root :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name '_' is not defined
sly root
#

ah

sly root
#

and it makes no sense to redefine _ using def

#

because it makes no sense to use _

sly root
#

@floral meteor if you still want to implement fp and oop in brainfuck, I've implemented the fp part

#
A=3
B=BRAINFUCK[
  PRINT[MATCH(A==3)[
    TRUE: "Hello",
    __: "Bye",
  ]],
  PRINT[MATCH(A<3)[
    TRUE: "Hello",
    __: "Bye",
  ]],
  DEFUN("test-func")[
    PRINT["HELLO FROM test-func"]
  ]
]
print(B)
_b(B)._i()
print("\n",__FUNCTIONS)```
#
('++++++++++[>+++++++>++++++++++>+++++++++++<<<-]>++.>+.+++++++..>+.>', '++++++++++[>++++++>++++++++++>++++++++++++<<<-]>++++++.>>+.<+.>', '')
HelloBye
 {'test-func': '++++++++++[>+++>++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++<<<<<<<<-]>>>>++.<+++++++++.>++++..+++.<<<++.>>>---------.>++.<+++++++++.--.<<<.>>>>>>>++++++.<+.>-.+.<<<<<<+++++.>>>>>+.>+.-------.<<+++++++++.>'}```
#

just saves the function body to dict using the provided function name

#

argument may be handled like in shell scripts using %* or with names enclosed in |...|

#

like %1, %argument, or |argument|

floral meteor
#

names? what do we need names for?

#

except for top level as a mask for a memory pointer

sly root
floral meteor
#

memory pointer

sly root
#

and not CALL(47)[...]

#

idk, dicts can have int as keys, so that's possible too

#
__FUNCTIONS={}
DEFUN=type("DEFUN",(),{})
DEFUN.__init__=lambda s,n,*a:(s.__setattr__("n",n),s.__setattr__("a",a),None)[-1]
DEFUN.__repr__=lambda s:""
DEFUN.__getitem__=lambda s,i:(__FUNCTIONS.update({s.n:{"body":i,"args":s.a}}),"")[-1]
floral meteor
#

X = FUNC(whatever)
would allocate a memory pointer to X and then
CALL.X ( ... )

sly root
#

I've rewritten it so it works on android without sigsegv

floral meteor
#

the allocation would be recorded in a dictionary

#

to implement objects we just need to allocate memory for them.
header 16 bytes:

  • size 8 bytes -> n
  • type 8 bytes
    body n bytes
  • data
    tail 1 byte
  • NULL
#

we can repurpose the comma character in the actual brainfuck interpreter to turn the output into a fifo stack, and what's left on stack is printed.

sly root
#

there's also an another problem

#

how to work with arguments if PRINT automatically converts everything into brainfuck

#

and every string in function body is accepted as one instruction

#

maybe the solution is to preprocess every string at first

floral meteor
#

PRINT.varname vs PRINT("raw string")

sly root
#

because I've added { and } to implement rshift and lshift 😅

floral meteor
#

if characters are added, it's a derivative of brainfuck, and defeats the purpose of brainfuck. It is Turing Complete, hence you theoretically do not need any more characters.

#

you could make an intermediate language with symbols for commonly used scripts that compile to lengthy brainfuckiness

#

like a sort of bytecode

night quarryBOT
sly root
restive void
#

Idea: implement IterationError, raised automatically when any loop reaches more than sys.getiterationlimit() iterations. You know, for fairness.

floral meteor
quartz wave
quartz wave
low pelican
#

!e

import inspect

def getlocals(code):
    varnames = code.co_varnames
    if code.co_argcount > 0:
        argspec = inspect.getargs(code)
        varnames = filter(
            lambda v: v not in argspec.args and v not in {"args", "kwargs"},
            code.co_varnames,
        )

    return zip(varnames, code.co_consts[1:])

def inside_out(fn):
    fn.__dict__.update(dict(getlocals(fn.__code__)))
    return fn

@inside_out
def foo():
    a = 1
    b = 2

print(foo.a)
print(foo.b)
night quarryBOT
#

@low pelican :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
wheat river
rich radish
#

hi guys i want to stard paython any course her pls?

wheat river
#

!resources

night quarryBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

wheat river
viscid hedge
#

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#

]

floral meteor
#

¯_(ツ)_/¯

split salmon
versed eagle
#

my mind cannot fathom such complicated concepts

vital dirge
#

boomshaka(laka)booBooBOOOM(SHAKA(LAKA))) -> "hello, world"

unreal echo
#

!e
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
]

night quarryBOT
#

@unreal echo :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     ]
003 |     ^
004 | SyntaxError: unmatched ']'
unreal echo
#

nani?

sick hound
#

The lambda?

unreal echo
#

it's not esoteric

#

it just needs a bit of will power to read

low pelican
#

its esoteric way lol😁

quartz wave
# low pelican !e ```py import inspect def getlocals(code): varnames = code.co_varnames ...

!e ```py
import inspect

def getlocals(code):
varnames = code.co_varnames
if code.co_argcount > 0:
argspec = inspect.getargs(code)
varnames = filter(
lambda v: v not in argspec.args and v not in {"args", "kwargs"},
code.co_varnames,
)
return zip(varnames, code.co_consts[1:])

def inside_out(fn):
fn.dict.update(dict(getlocals(fn.code)))
return fn

@inside_out
def foo(*, a=4):
b = 3

print(foo.a)
print(foo.b)

night quarryBOT
#

@quartz wave :x: Your eval job has completed with return code 1.

001 | 3
002 | Traceback (most recent call last):
003 |   File "<string>", line 22, in <module>
004 | AttributeError: 'function' object has no attribute 'b'
quartz wave
#

you forgot to handle kwargs

fathom musk
#

how do i do this in an esoteric way?

{k: await filtered(v.get_commands()) for k, v in self.context.bot.cogs.items() if await filtered(v.get_commands())}```
night quarryBOT
#

@quartz wave :white_check_mark: Your eval job has completed with return code 0.

001 | 6
002 | 7
quartz wave
#

!e ```py
def inside_out(fn):
code=fn.code
varnames=code.co_varnames
flags=code.co_flags
posargc=code.co_posonlyargcount
argc=code.co_argcount
kwargc=code.co_kwonlyargcount
varnames_argc=varnames[:argc]
offs=argc+kwargc
varnames_kwargc={*varnames[argc:offs]}
name_varg=(flags&4)!=0 and varnames[offs]
name_vkwarg=(flags&8)!=0 and varnames[offs+1]
if argdef := fn.defaults:curlocals=dict(zip(varnames[argc-len(argdef):argc],argdef))
else:curlocals={}
if kwargdef := fn.kwdefaults:curlocals |= kwargdef
fn.dict.update(curlocals)
def test_args(): pass
test_args.code=(test_args.code.replace(co_argcount=argc,co_posonlyargcount=posargc,co_kwonlyargcount=kwargc,co_varnames=varnames,co_flags=flags,co_name=code.co_name,co_nlocals=code.co_nlocals))
code=code.replace(co_argcount=0,co_posonlyargcount=0,co_kwonlyargcount=0,co_code=code.co_code.replace(b'}',b'Z').replace(b'|',b'e').replace(b'~',b'['),co_names=varnames)
@lambda c:c()
class fno:
nonlocal curlocals
def getattribute(self,x):
loc=object.getattribute(self,"locals")
return loc[x] if x in loc else fn.getattribute(x)
def call(self,*args,**kwargs):
test_args(*args,**kwargs)
loc=object.getattribute(self,"locals")
loc.update(zip(varnames[:argc],args[:argc]))
if name_varg is not False:
loc[name_varg]=args[argc:]
loc.update({k:kwargs.pop(k)for k in kwargs if k in varnames_kwargc})
if name_vkwarg is not False:
loc[name_vkwarg]=kwargs
return eval(code,globals(),loc)
@property
def locals(self):
return curlocals
@locals.setter
def _(self,x):
nonlocal curlocals
if not isinstance(x,dict):
raise TypeError("locals must be set to a dict object")
curlocals=x
@locals.deleter
def _(self,x):raise TypeError("locals must be set to a dict object")
return fno
@inside_out
def foo(c=3):
a=c+1
b=c+2
print(f"{foo.c=}")
foo(5)
print(f"{foo.c=}")
print(foo.a)
print(foo.b)

night quarryBOT
#

@quartz wave :white_check_mark: Your eval job has completed with return code 0.

001 | foo.c=3
002 | foo.c=5
003 | 6
004 | 7
quartz wave
#

@low pelican better
had to remove some stuff to fit it in the discord message limit

quartz wave
cinder shard
# quartz wave !e ```py def inside_out(fn): code=fn.__code__ varnames=code.co_varnames flags...

someone should turn this into a rap song and deliver it like this

https://www.youtube.com/watch?v=uU-tP1_lJzs

bladee - Inside Out feat. Yung Lean (prod. ripsquad)

Artist : bladee
http://soundcloud.com/bladee1000
http://instagram.com/dg_bladee
http://twitter.com/BladeeCity

Follow Unheard
http://soundcloud.com/unheardrap
http://twitter.com/unheardrap_
http://spoti.fi/2S2Hver

Unheard is a promotional channel which aims at uploading new and underrated So...

▶ Play video
soft vapor
#

hey how do you get cash on bit coin found with python

sick hound
#

!e
import math
from itertools import product
sx, sy = 40, 26

[print(chr(10240+int(''.join(map(lambda i:str(1*((lambda x,y:-max(-((0.4*(x+2.5))(2)+10*(2*(y-0.6)+(math.sin(4*(2*x+2)*0.4))/(4))(2)-1),-((x-1.7)(2)+(y-2.2-(math.sin(abs(x-2.3)))/(2))(2)-1),-min(min((abs(2*(y+3.5)+abs((x-2.5)))+abs((x-2.5))-1),max(0.8abs((x-2.5)),0.15abs((y+3.5)-2))-0.3),min((abs(2*(y+4)+abs((x-(2.9)/(3))))+abs((x-(2.9)/(3)))-1),max(0.8abs((x-(2.9)/(3))),0.15abs((y+4)-2))-0.3),min((abs(2*(y+4)+abs((x+2.5)))+abs((x+2.5))-1),max(0.8abs((x+2.5)),0.15abs((y+4)-2))-0.3),min((abs(2*(y+3.5)+abs((x+(2.9)/(3))))+abs((x+(2.9)/(3)))-1),max(0.8abs((x+(2.9)/(3))),0.15abs((y+3.5)-2))-0.3)),-(0.3x**(2)+0.25y**(4)-2**(2)),-((x-3)(2)+(y-0.5-(x)/(3))(2)-3)((x-3.6)(2)+(y-2.75)(2)-0.3**(2)),-(0.2(x-5.8)(2)+(3*(y-(x)/(3)-1)+math.sin(2*x))(2)-0.75))-0.08)((152bx+i%2)/(2sx)+2,-15(4by+(i//2))/(4sy))<=0)),map(int,'76531420'))),2)),end='\n'*((bx-1-sx//2)%sx==0)) for by,bx in product(range(6-sy//2,sy//2-5),range(1-sx//2,sx//2-4))]

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | ⠀
002 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
003 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣶⣿⣿⣶⠀⣀⣶⣶⣶⣄⠀⣀⣶⣿⣶⣤⣤⣶⠛⠀
004 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣁⣿⣿⣴⠿⠉⠀⠉⠙⠛⠀⠀⠀
005 | ⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⣀⣀⣛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀
006 | ⠀⠀⠀⠀⣀⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀
007 | ⠀⠀⠀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
008 | ⠉⠛⠉⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
009 | ⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
010 | ⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
011 | ⠀⠀⠀⠀⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/enuyikojiv.txt?noredirect

sick hound
#

!e print('ㅎㅎ')

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

ㅎㅎ
sick hound
#

!e import disnake

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'disnake'
wheat river
#

#bot-commands

verbal spear
#

!e
import math
from itertools import product
sx, sy = 40, 26

[print(chr(10240+int(''.join(map(lambda i:str(1((lambda x,y:-max(-((0.4(x+2.5))(2)+10(2(y-0.6)+(math.sin(4(2x+2)0.4))/(4))(2)-1),-((x-1.7)(2)+(y-2.2-(math.sin(abs(x-2.3)))/(2))(2)-1),-min(min((abs(2(y+3.5)+abs((x-2.5)))+abs((x-2.5))-1),max(0.8abs((x-2.5)),0.15abs((y+3.5)-2))-0.3),min((abs(2(y+4)+abs((x-(2.9)/(3))))+abs((x-(2.9)/(3)))-1),max(0.8abs((x-(2.9)/(3))),0.15abs((y+4)-2))-0.3),min((abs(2(y+4)+abs((x+2.5)))+abs((x+2.5))-1),max(0.8abs((x+2.5)),0.15abs((y+4)-2))-0.3),min((abs(2(y+3.5)+abs((x+(2.9)/(3))))+abs((x+(2.9)/(3)))-1),max(0.8abs((x+(2.9)/(3))),0.15abs((y+3.5)-2))-0.3)),-(0.3x*(2)+0.25y(4)-2(2)),-((x-3)(2)+(y-0.5-(x)/(3))(2)-3)((x-3.6)(2)+(y-2.75)(2)-0.3**(2)),-(0.2(x-5.8)(2)+(3(y-(x)/(3)-1)+math.sin(2x))(2)-0.75))-0.08)((152bx+i%2)/(2sx)+2,-15(4by+(i//2))/(4sy))<=0)),map(int,'76531420'))),2)),end='\n'*((bx-1-sx//2)%sx==0)) for by,bx in product(range(6-sy//2,sy//2-5),range(1-sx//2,sx//2-4))]​

#

I am new here...why doesn't it work?

jaunty frigate
#

try putting it in a code block, like:
!e
```
code here
more code here
```

sick hound
#

!e

print("Hello, World!")
night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
sick hound
#

Very esoteric

floral meteor
#

!e ```py
from ctypes import*
class output:
def init(self, victim):
self.victim=id(victim);ol = len(victim)
(c_char*ol).from_address(id(victim)+48)[:]=[0]*ol
c_longlong.from_address(id(victim)+16).value=0
self.backup = [0]ol, ol
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)
self.backup[0].append(_a.value);_a.value=-item;return 0;
def del(self):
v, i = self.backup
c_longlong.from_address(self.victim+16).value = i
(c_byte
len(v)).from_address(self.victim+48)[:]=v
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 run(self, c):
p=t=0
try:
while 0<=p<len(c):
if t:t+=(c[p]=='[')-(c[p]==']')
else:t={
'+':self.inc,'-':self.dec,'<':self.left,'>':self.rite,
'.':self.dot,',':self.com,'[':self.loop,']':self.endl
}.get(c[p],lambda:0)()
p+=1-2
(t<0)
except KeyboardInterrupt:pass
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_byte
l).from_address(a.o.victim+48)
_,*data[:-1]=data;import('sys')._getframe(1).f_globals[_n[0]]=a.o;_n[0]+=1

code = "++++++++++[>+++++++>++++++++++>+++>+++++++++++<<<<-]>++.>+.+++++++..+++.>++++++++++++++.------------.<<+++++++++++++++.>.+++.>>--.--------.<+."
print(code)
brainfuck(code)
print(code)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | ++++++++++[>+++++++>++++++++++>+++>+++++++++++<<<<-]>++.>+.+++++++..+++.>++++++++++++++.------------.<<+++++++++++++++.>.+++.>>--.--------.<+.
002 | Hello, World!
floral meteor
#

it segfaults in 3.11

floral meteor
#

the comma just uses the output as the input

floral meteor
#

!e I got commas working properly now ```py
from ctypes import*
class output:
def init(self, victim):
self.victim=id(victim);ol = len(victim)
(c_char*ol).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 run(self, c):
p=t=0
try:
while 0<=p<len(c):
if t:t+=(c[p]=='[')-(c[p]==']')
else:t={
'+':self.inc,'-':self.dec,'<':self.left,'>':self.rite,
'.':self.dot,',':self.com,'[':self.loop,']':self.endl
}.get(c[p],lambda:0)()
p+=1-2
(t<0)
except KeyboardInterrupt:pass
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_byte
l).from_address(a.o.victim+48)
_,*data[:-1]=data;import('sys')._getframe(1).f_globals[_n[0]]=a.o;_n[0]+=1

code = "++++++++++[>+++++++>+++++++++++>+++<<<-]++++++++++>++>--.>++.<.<.>-------.,..+++.>++++++++++++.,.+<<+++++++++++++++.>.+++.,.--------.>.<<<."
print(code)
brainfuck(code)
print(code)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | ++++++++++[>+++++++>+++++++++++>+++<<<-]++++++++++>++>--.>++.<.<.>-------.,..+++.>++++++++++++.,.+<<+++++++++++++++.>.+++.,.--------.>.<<<.
002 | Hello, World!
floral meteor
#

no segfault in 3.11 now

#

unless the output is longer than the code...

#

for some reason the cleanup was killing it

#

using the output as a fifo stack for the input is merely there as a way to encode the input in the code

graceful flame
#

Hi everyone,
I would like to ask for someone who can help me with this python programme. In fact, I am quite confused about how to write because I am a beginner. So, if someone can help, I am so thankful. I am sure it is an easy task that takes no more than 30 minutes. I will attach the file below.
Thanks,

night quarryBOT
#

Hey @graceful flame!

It looks like you tried to attach file type(s) that we do not allow (.pdf). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

floral meteor
floral meteor
#

!paste for files

night quarryBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

vital dirge
#

@quartz wave Hello. I was looking up at the code above, and I noticed this line. What's the purpose of it?

@lambda c: c()
class MyClass:
  def __call__(self, *args, **kwargs): pass

It appears that the decorator just turns MyClass into a function .. why not just declare MyClass as a function from the beginning, then?

royal whale
#

Possibly it's just part of the code

vital dirge
wheat river
#

thats the same as doing

class Foo:
    ...

Foo()
vital dirge
#

So like he could have just done "def myClass()"

#

instead of the lambda trick

wheat river
#

its a class, they are two different things

vital dirge
#

Understood

#

I'm asking what is the point of the lambda decorator at the beginning

royal whale
#

Ah

wheat river
vital dirge
#

ok, give example

#

so like

#

I could do myNewClass = MyClass ?

wheat river
#

!e

class Foo: ...
print(Foo)
Foo = Foo() # basically what the decorator is doing
print(Foo)
night quarryBOT
#

@wheat river :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | <class '__main__.Foo'>
002 | <__main__.Foo object at 0x7f698ccafb90>
vital dirge
#

and that would instantiate it, instead of "myNewClass = MyClass()" ?

royal whale
#

That's just saying 'whenever I reference MyClass I instantiate it, so MyClass()
To actually use the __call__ func you need to do MyClass()()

vital dirge
#

oh

royal whale
#

Which with the decorator would be MyClass()

vital dirge
#

sure

wheat river
#

!e

@lambda _: _()
class Foo: ...
print(Foo)
night quarryBOT
#

@wheat river :white_check_mark: Your 3.11 eval job has completed with return code 0.

<__main__.Foo object at 0x7f17474d3d10>
vital dirge
#

alright, so it is just a way to instantiate the class without (), lol, ok

royal whale
#

Yeah

vital dirge
#

what is the use of such a construction

#

?

royal whale
#

For example:

wheat river
#

ig thats one way of making a singleton class

#

you only have one instance

royal whale
#
import random

@lambda _: _()()
class Frue:
  """True or false?"""
  def __call__(self):
    return random.choice((True, False))

Frue # random bool
#

Then it's more like a True/False- you don't use parens on those

vital dirge
#

hmm ok

devout wraith
#

Gonna have to use that

vital dirge
#

@devout wraith don't forget Talse

devout wraith
#

My Frue or Tralse guesser is pretty important

devout wraith
royal whale
#

'Twas inspired by esoterrible library

#

Which, sadly, doesn't install on one PC I use

vital dirge
#

what's it do?

wheat river
night quarryBOT
#

@wheat river :white_check_mark: Your 3.11 eval job has completed with return code 0.

False
old socket
#

@lambda _: _() is cringe (joking) I usually use @type.__call__

earnest wing
#

idea: __rgetitem__ and __rgetattr__ for the reversed y[x] and y.x operators

wheat river
dusty lark
#

okay why did discord show me a 5 day old message

floral meteor
serene stratus
#

discord is high quality

#

I can definitely imagine some of their production code would fit perfectly in this channel

floral meteor
#

if the variable names aren't entire sentences, that is.

versed eagle
#

this is a bit less esoteric and a bit more math

#

but

#

!e I like how octal 0 looks, so I'm using it to make hello world :p

print("".join([chr(OoO)for OoO in[(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)),(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|(((-~0o0+-~0o0)<<(-~0o0))+-~0o0),(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<-~0o0),(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<-~0o0),(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<-~0o0)|(-~0o0+-~0o0)|-~0o0,((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0)),(-~0o0<<((-~0o0+-~0o0)<<-~0o0|(-~0o0+-~0o0)|-~0o0))-(-~0o0<<-~0o0<<-~0o0<<-~0o0)+~0o0,(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<-~0o0)|(-~0o0+-~0o0)|-~0o0,((-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<-~0o0)|(-~0o0+-~0o0))+(-~0o0<<-~0o0<<-~0o0),(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<(-~0o0+-~0o0))|((-~0o0+-~0o0)<<-~0o0),(-~0o0<<(-~0o0+-~0o0)<<(-~0o0<<(-~0o0+-~0o0)))|((-~0o0+-~0o0)<<(-~0o0+-~0o0)<<(-~0o0+-~0o0))|(((-~0o0+-~0o0)<<-~0o0))]]))
night quarryBOT
#

@versed eagle :white_check_mark: Your 3.11 eval job has completed with return code 0.

hello world
versed eagle
#

sorry I used chr, I haven't found a good alternative yet

tulip blaze
#

im so confused looking at that

royal whale
tulip blaze
old socket
night quarryBOT
#

@old socket :white_check_mark: Your 3.11 eval job has completed with return code 0.

4
#

@tulip blaze :white_check_mark: Your 3.11 eval job has completed with return code 0.

1
versed eagle
#

I use chr

#

that's all the hint I'll give

versed eagle
versed eagle
#

bitshifts are my friend here

versed eagle
versed eagle
floral meteor
versed eagle
#

ah
i was messing around with (thing.append(c) if c not in thing else ...)for c in "".join(dir("")+dir({})) because the combination of those two has every letter

floral meteor
#

Or read from memory addresses with extreme offsets.

versed eagle
#

thing.append(str(_)) for _ in range(10) gets numbers

#

(thing is a list btw)

#

then you use thing="".join(thing)

#

then get an index of thing

versed eagle
versed eagle
versed eagle
#

where do you get y from

#

i cant think of something off the top of my head that has y

floral meteor
#

If you're familiar with consecutive string objects in memory, you can access an interned string in front of a built-in doc string, artificially increase its length, then getitem extreme values

floral meteor
#

Eh just dig around you'll find something

versed eagle
#

ive never messed around with memory before

#

(in python, that is)

floral meteor
#

!e ```py
from ctypes import *
victim = "victim"
c_longlong.from_address(id(victim)+16).value = 256
print(repr(victim))

night quarryBOT
#

@floral meteor :white_check_mark: Your 3.11 eval job has completed with return code 0.

'victim\x00\x00¨uã\x0cp\x7f\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x80²â\x0cp\x7f\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00/çb¹Fð\xa0öäÅO\x0cp\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00victim\x00\x00\xa0ÅO\x0cp\x7f\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x80²â\x0cp\x7f\x00\x00\n\x00\x00\x00\x00\x00\x00\x00AY}.\x1a\x8b!ðå\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00c_longlong\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x80²â\x0cp\x7f\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00Ë>\x9eñ/\x02\x8côå\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00from_address\x00\x00\x00\x00°·P\x0cp\x7f\x00\x00ÀºP\x0cp\x7f\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x02ã\x0cp\x7f\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00pºP\x0cp\x7f\x00\x00'
floral meteor
#

There you go, the name c_longlong is in there

versed eagle
#

ok so you just do that and dig around a ton till you find the right chars

floral meteor
#

Looks like the memory for the code object for globals frame

#

You could reference a whole bunch of names after an if 0:

#

Then read memory to find those names after a previous variable definition

#

Will look like real hackerman code if executed well

#

I'm gonna do it on maybe 4 hours if I remember

old socket
#

!e ```py
print(import("\x74\x65\x78\x74\x77\x72\x61\x70").shorten.doc[331:343])

night quarryBOT
#

@old socket :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello world!
versed eagle
#

!e

print("\x74\x65\x78\x74\x77\x72\x61\x70")
night quarryBOT
#

@versed eagle :white_check_mark: Your 3.11 eval job has completed with return code 0.

textwrap
versed eagle
#

aha

floral meteor
#

!e I have ascended to a higher plane of reality```py
from ctypes import *
victim = "victim"
if(255<<255)*(255>>255):hello, world
c_longlong.from_address(id(victim)+16).value = 1024
print(victim[128:133],victim[192:197])

night quarryBOT
#

@floral meteor :white_check_mark: Your 3.11 eval job has completed with return code 0.

hello world
floral meteor
#

some programmers push hello world to a stack.
some programmers store hello world as a variable.
I throw hello world into the oblivion then fish for it.

floral meteor
#

the mathy bit is so the variable names don't get optimised out of existence

floral meteor
#

in the terminal, it only sometimes works

#

!e from ctypes import *
victim = "victim"
if(255<<255)(255>>255):this, that, something, everything
c_longlong.from_address(id(victim)+16).value = 1024
print(
[victim[n:n+k]for n,k in zip(range(128,4*128,64),[4,4,9,10])])

night quarryBOT
#

@floral meteor :white_check_mark: Your 3.11 eval job has completed with return code 0.

this that something everything
floral meteor
#

code blocking it would not make it more understandable.

#

this is like dropping a bottle with a message into the ocean, then knowing exactly where it will float to and picking it up there. Technically it shouldn't work.

quartz wave
#

also is that just using co_names or something

floral meteor
quartz wave
#

ok

floral meteor
#

I could probably pick up their lengths

#

by reading 96 with 64 byte increments

floral meteor
#

specifically the contents of it?

#

I can't seem to fetch the lengths of the co_names

quartz wave
floral meteor
#

string length isn't where it's supposed to be in memory

#

is the type and encoding omitted?

quartz wave
floral meteor
#

if i read position 96 it should tell me the length of the string body at position 128

quartz wave
#

!e ```py
from ctypes import *
victim = "victim"
if(255<<255)(255>>255):this, that, something, everything
c_longlong.from_address(id(victim)+16).value = 1024
print(
[cast(id(victim)+n, py_object)for n in [-64, 64, 128, 192, 256, 320, 384, 448, 512]])

night quarryBOT
#

@quartz wave :white_check_mark: Your 3.11 eval job has completed with return code 0.

py_object('ctypes') py_object('victim') py_object('this') py_object('that') py_object('something') py_object('everything') py_object('c_longlong') py_object('from_address') py_object('py_object')
quartz wave
#

chilaxan if you see this pls explain

floral meteor
#

^ is platform dependant @rugged sparrow

#

sneaky way to print hello world in linux , but it does licen 0408 on windows.

#

is it telling me I need a license to print hello world in windows?

#

007: License To Print("Hello, World!")

#

*James Bond music*