#esoteric-python

1 messages Β· Page 101 of 1

fiery hare
#

no

terse mortar
#

Yes

#

It's true

fiery hare
#

that's negative self-talk

terse mortar
#

But it's true

#

Plus it's referring to myself, so does it rly matter?

fiery hare
#

why would you be meaner to yourself than you would be to other people?

terse mortar
#

Because I struggle with self confidence πŸ™ƒ

tribal moon
terse mortar
#

What the fuck

#

Amazing

fiery hare
#

and that's, like, the exact opposite of what makes sense.

sick hound
#

if your self confidence is bad you should work on improving it instead of saying things that make it even worse 🀨

terse mortar
#

Right, but like, it's not that easy. Plus I'm so fucked up anyways lol, that my self confidence isn't rly a big problem. If you want to get more into it, y'all can dm me, but we probably shouldn't do this here.

cloud garden
#
def all_numbers():
    n = 0
    while True:
        n += 1
        yield n

how could I make this function in one line?

fiery hare
#

hmmmmmmmmmmmm

#

maybe with a generator expression?

#

and the walrus operator?

cloud garden
#
def all_numbers():
    n = 0
    while True: yield (n := n + 1)

walrus can do that

steep mural
#

all_numbers = lambda n=0: (n := n + 1, (yield n), (yield from all_numbers(n))

#

Eventually you will die of recursion error

cloud garden
#

ahh that is cool

#

but yea you only get to 999

fiery hare
#

!e

all_numbers = (lambda n=0: (n := n + 1, (yield n), (yield from all_numbers(n)))
all_numbers()
night quarryBOT
#

@fiery hare :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     all_numbers()
003 |     ^
004 | SyntaxError: invalid syntax
steep mural
#

I wonder if you could reallocate the call stack with ctypes or something something... probably not but would be interesting

tribal moon
#

missing a closing bracket at the end there

fiery hare
#

!e

all_numbers = (lambda n=0: (n := n + 1, (yield n), (yield from all_numbers(n))))
all_numbers(10)
night quarryBOT
#

@fiery hare :warning: Your eval job has completed with return code 0.

[No output]
zinc patio
#

!e

print("hello") 
night quarryBOT
#

@zinc patio :white_check_mark: Your eval job has completed with return code 0.

hello
zinc patio
#

YOOO THAT'S SO COOL

#

If anyone know if I cna get the source code of this bof

#

Bot

#

Cuz I kinda wanna try to hack it

night quarryBOT
#
Command: eval

Run Python code and get the results.

Source Code
terse mortar
zinc patio
#

Rip πŸ™

#

Make it 4 😀

#

But am I allowed to try?

terse mortar
sick hound
#

!e

while True:
    print("the")
night quarryBOT
#

@sick hound :x: Your eval job timed out or ran out of memory.

001 | the
002 | the
003 | the
004 | the
005 | the
006 | the
007 | the
008 | the
009 | the
010 | the
011 | the
... (truncated - too many lines)

Full output: too long to upload

last locust
#

#bot-commands for testing please @sick hound

sick hound
#

ight

stark fable
#

idk if there's a way to do it "properly" without using itertools like that

#

alright actually this works py all_numbers = type('',(),{'__init__':lambda a:a.__setattr__('i',0),'__iter__':lambda a:a,'__next__':lambda a:a.__setattr__('i',a.i+1)or a.i})

#

it's not strictly a function anymore but you can call it and it will behave like the function did

#

@cloud garden

proper vault
#

I would do

all_numbers = lambda: iter(lambda n=[-1]: next(n[0] for n[0] in [n[0]+1]), None)
#

I remember there being a golf about this a while back

rugged sparrow
#

!e py all_nums=iter(lambda n={0:0}:[n[0],n.update({0:n[0]+1})][0],-1) for i in range(20):print(next(all_nums))

night quarryBOT
#

@rugged sparrow :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
011 | 10
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/yarilateqa.txt

stark fable
#

oh yeah i forgot about iter

prisma lynx
#

how do you get into esoteric python?

#

it seems interesting

verbal totem
#

Write terribly illegible, working code
Usually all done on one line @cani#6647

naive roost
#

or modifying Python's base behaviour on the fly

verbal totem
naive roost
#

definitely. If it's totally weird, it probably belongs here

verbal totem
#

I swear I saw this somewhere, proving that people need to put more effort in finding the right people for the right job:

if False == False:
    return True
pale bobcat
#

bruh

floral meteor
#
yield False==False and True or False
#
class Maybe:
 def _rat_mat(s,n):
  b=c=1
  while not-2**-10<n-int(n)<2**-10:c+=1;n*=c;b*=c
  return[*[True]*int(n),*[False]*int(b)]
 def __init__(s,n:float=1.0):s.l=__import__('math').log;s.c=n>0 and s._rat_mat(n)or(n<0 and s._rat_mat(-1/n))or True;s.r=__import__('random')
 __bool__=lambda s:s.r.choice(s.c)
#

wat

#

!e ```py
def _rat_mat(n):
a,b,c=n,1,1
while not-2**-10<a-int(a)<2**-10:c+=1;a*=c;b*=c
return[*[True]int(a),[False]*int(b)]
{print(rat_mat())for _ in[0.1,1.4,2.4,0.00343581,0.5158,26.2,98765.000002]}

night quarryBOT
#

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

001 | [True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
002 | Traceback (most recent call last):
003 |   File "<string>", line 5, in <mod
... (truncated - too long)

Full output: https://paste.pythondiscord.com/enikehocaw.txt

floral meteor
#

there

#
MemoryError
```LMAO
#

me: evaluate simple algorithm
bot's last two brain cells: monke think

#

how do I get the numerator and denominator of a float separated?

#

into a tuple

#

something like...

def _frac_float(n):
  if-2**-10<n-int(n)<2**-10:return n,1
  else:...
def _rat_mat(n):a,b=_frac_float(n);return[*[True]*a,*[False]*b]

without importing math

#

or is there a thing I could do to go through 128 iterations and do something to n, and if certain conditions apply to n, assign True, else False, then return the thingy...
πŸ€”

#

oof

#

the bot hates me now

#

bruh

#

okay I think this is an algorithm issue not an esoteric topic. I'll make it non-esoteric-coder friendly

#

ow it hurts my eyes already :P

rugged sparrow
#

!e py x = 1.2 print(x.__trunc__()) print(x.__ceil__())

night quarryBOT
#

@rugged sparrow :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
rugged sparrow
#

@floral meteor ^ i think that works

floral meteor
#

i'd expect that output for 0.5

#

!e
rn I'm trying to get at least this to work, I'll try this

def _rat_mat(n):
  n = (n<0) and -n or +n
  if -10**-10 < n-int(n) < 10**-10:f = [*[True]*int(n), False]
  else:
    f=[]
    for i in range(128):
      if n>1: f.append(True);n-=1/(i+1)
      else:   f.append(False);n+=1/(i+1)
  return f
print({this:_rat_mat(this)for this in [0.1,0.2,0.5,1.2,5,0.3]})
#

well that does something

#

!e ```py
def _rat_mat(n):
n = (n<0) and -n or +n
if -10**-10 < n-int(n) < 10**-10:f = [*[True]*int(n), False]
else:
f=[]
for i in range(128):
if n>1: f.append(True);n-=1/(i+1)
else: f.append(False);n+=1/(i+1)
return f
def _frac(m):
a=b=0
for this in m:
if this:a+=1
else:b+=1
return f"{a}/{b}"
print({this:_frac(_rat_mat(this))for this in [0.1,0.2,0.5,1.2,5,0.3]})

night quarryBOT
#

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

{0.1: '63/65', 0.2: '63/65', 0.5: '64/64', 1.2: '63/65', 5: '5/1', 0.3: '64/64'}
rugged umbra
#

when you run eval it evaluates your code against something? asking for a friend @floral meteor lol

floral meteor
#

si'?
wdym?

#

when you run eval it evaluates the string as python and returns the value the evaluation returned.

#

like in prompt when you enter a string into stdin followed by a newline, it evalautes that and prints the value

#

so eval is like that but it returns string instead of printing it

#

and it inputs string instead of raw code

#

alright...
!e ```py
class Maybe:
def _rat_mat(s,n):
r = n.as_integer_ratio()
_={(r:=(int(r[0]/100000),int(r[1]/100000)))for _ in iter(lambda:r[0]>1000 and r[1]>1000, False)}
a,b=r
return[*[True]a,[False]*b]
def init(s,n:float=1.0):s.l=import('math').log;s.c=n>0 and s._rat_mat(n)or(n<0 and s._rat_mat(-1/n))or True;s.r=import('random')
bool=lambda s:s.r.choice(s.c)
{Maybe(0.2) and print("Low Battery") for _ in range(50)}

rugged umbra
#

the string as in the string typed into discord message?

floral meteor
#

bot ded lol

#

eh, I was talking about python shell

#

if you did eval on a discord message, people would hack ur bot

rugged umbra
#

i guess i'm wondering more how you are running code in discord

#

lol

#

noted

floral meteor
#

running code in discord is actually a complicated process...
essentially, you don't want print to actually print to stdout, but to a file, which you then read.

#

or set sys.stdout to a file handle

#

which you then read and wipe when you read

#

and you also gotta filter out harmful commands

#

it's a lot of stuff to do

rugged umbra
#

okay so the bot is interpreting your code? in a way?

floral meteor
#

in my bot I just did

    if message.author.id in FRIENDLY_IDS and message.content.translate(str.maketrans('','',string.punctuation)).lower().startswith(
            'python'):global msg;msg=await send(message.channel,str(process_python_command(message)))
    ```
#

instead of filtering

rugged umbra
#

does this alert you when friendly people msg you

floral meteor
#

no, when a friendly person requests to evaluate some code, it passes the code to process_python_command then sends the output back to them

#

the function itself is an eyesore, and not actually finished.

def process_python_command(m):
 c=m.content[len(m.content.split()[0])+1:]
 try:return eval(c,__locals=globals())
 except Exception as e:
  b=globals().copy()
  try:exec(c,globals(),globals());return"Executed with exit code `0`."+(globals()!=b)*(" Changed variables:\n"+str({this:globals()[this]for this in globals() if this not in b or b['this']!=globals()['this']}))+((f:=open(_STDOUT,'r')).read()and[f.seek(0),f.read(),f.close(),open(_STDOUT,'w').close()][1])
  except Exception as _e:return"Executed with exit code `1`."+str({'eval':str(e),'exec':str(_e)})

#

since you asked in the esoteric-python channel, you get to look at ugly code like this

rugged umbra
#

that's what i'm here for i assure you

floral meteor
#

you and I are two of the few people brave enough to combine esoteric python with discord.py

#

hol up

rugged umbra
#

didn't even get a chance to read it all lol

floral meteor
#

it copied a different section to what i highlighted lol

#

doxx

#
# redirects
log=lambda *s,sep=' ',end='\n':os.system("")or sys.__stdout__.write(sep.join(s)+end)
print=lambda *s,sep=' ',end='\n',file=_STDOUT:[(f:=(open(file or _STDOUT,'a'+'b'*isinstance(s,bytes))if isinstance(file,str)else file)).write(sep.join(s)+end),f.close(),None][2]
switch={'input':{},'password':{}}
async def input(p,m,f,*args,**k): # k should not include p m f k id args user channel message
    """

    :param p: prompt
    :param m: message object
    :param f: function to execute on input
    :param args: args for f
    :param k: kwargs
    :return: message object
    """
    global switch;msg=await m.channel.send(p)
    switch['input'].update({'message':m,'target':f,'args':args,'kwargs':k})
    return msg[0]
#

you see I made an entirely new print function

#

and a log function to 'actually' print

#

also, 'actual' input will block the client.run which makes it puke

rugged umbra
#

you wouldn't call it like print tho, but call it once, by itself so it prints the output of the program that it's running in?

floral meteor
#

you would have "the program that's running" print to a file, then you would read that file if you wanted to know its contents

#

i.e. either hack print or sys.stdout

#

you could do

sys.stdout=open('thingy.txt','w+')
#

then if you needed text in the host window you'd raise error or warning

rugged umbra
#

so..how do you use log then

#

not trying to be sassy πŸ˜…

floral meteor
#
async def on_ready():__name__=='__main__' and(log(">>> __import__('time').sleep(99999999)\n")or 1)or(not os.system("")and log("\x1b[33mRunning outside of main thread.\x1b[0m"))
#
async def on_message(message):
  not os.system("")and log("\x1b[32mProcessing Data package. id:",message.id.__str__(),'\x1b[0m')
  ...
rugged umbra
#

oh

floral meteor
#

also...

#
async def send(channel,result:str,format='',tts=False):
  s=1990-len(format);return[await channel.send(f"{'`'*3}{format}\n".__mul__(format!='')+result[i:i+s]+3*"`".__mul__(format!=''),tts=tts)for i in range(...!=...,len(result),s)]
log=lambda *s,sep=' ',end='\n':os.system("")or sys.__stdout__.write(sep.join(s)+end)
switch={'input':{},'password':{}}
async def input(p,m,f,*args,**k): # k should not include p m f k id args user channel message
    __doc__="""
    :param p: prompt
    :param m: message object
    :param f: function to execute on input
    :param args: args for f
    :param k: kwargs
    :return: message object
    """
    global switch;msg=await m.channel.send(p)
    switch['input'].update({'message':m,'target':f,'args':args,'kwargs':k})
    return msg[0]
async def on_message(message):
  not os.system("")and log("\x1b[32mProcessing Data package. id:",message.id.__str__(),'\x1b[0m')
  global msg,switch;msg=switch['input']and[message.channel,message.author]==[switch['input']['message'].channel,switch['input']['message'].author]and[await send(message.channel(switch['input']['f'](*switch['input']['args'],**switch['input']['k']))),switch.update({'input':{}})][0]or msg
  ...
#

so you gotta override a lot of builtin functions to capture the stdout

#

and I haven't even started trying to protect from 'shell injection'

rugged umbra
#

if you wrote things like "\x1b[32mProcessing Data package. id:",message.id.__str__(),'\x1b[0m' into the shell you mean?

floral meteor
#

yeah if you wanted to write some flippityfloppityfunnylooking to the shell, you use a different function that writes directly to stdout

#

either that, or write to a log file, and run a separate process that prints the contents of the file as they appear

#

something like...

while True:
  try:
    with open("bot-logs.txt",'r') as file:print((c:=file.read()))
    c and open("bot-logs.txt",'w').close()
  except FileNotFoundError:exit()
rugged umbra
#

how many functions can you tie together with and that's the first time i've ever seen that used

floral meteor
#

which is started by something like

__import__('os').system("START /b print-logs.py")

at the start of your file

#

as long as they can all be interpreted as expressions, you can go as crazy as you like with and and or

#

if you want to assign a variable in one of these boolean chains...

d = this and [(f:=do_that()),"aaaa"] or (f:=go_crazy())+2
#

'walrus operator'

#

anyways i gotta go bye

rugged umbra
#

thanks!

floral meteor
#

Also...
{print("Low Battery") for I in range(24)}
Will not fill your memory with 24 Nones like if you used [...]

golden fjord
#

What are some general rules of writing esoteric python and are there any articles to read this about?

stark fable
#

well i imagine there's lots of articles and rules about writing normal python, so read those and use that as what not to do when writing esoteric python

#

if there's something particular you're going for like maximal obfuscation (make code hard to read) or golfing (making the code as short as possible) you can probably find things to help with those specifically

thin trout
sick hound
#

list comprehension!

#

very nice

wooden prism
#

hello every body in ther

#

there

terse mortar
#

Hello.

sick hound
#

still coming up with new ideas though

tribal moon
#

I wanna make a code generator this, a one line discord.py bot code generator

#

imagine how awesome that'd be

sudden willow
#

!e

print(''.join((str(...).lower()[1], str(bool)[10], str(...).lower()[1])))
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

lol
sudden willow
#

making lol with the L from ellipsis, o from bool, and another L from ellipsis

sudden willow
#

!e

print(chr(int(ord(str(True)[0])).__sub__((True.__int__().__add__(True.__int__()).__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__mul__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True))))))))))))
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

K
sudden willow
#

playing around with ascii values

tribal moon
#

maybe you can change True to ....__hash__().__bool__()

#

idk

sick hound
#

creative

floral meteor
#

What I really want to know is....

floral meteor
#

!e ```py
k=0
class CursedF(int):
def init(s,*args):s.init=0;super().init(args and args[0]or 0)
def pow(s, n):
if not s.init:s+=n;s.init+=1;return s
else:return CursedF()int.pow(s,n)
def add(s,o=1):return super().add(o,self=s)
cursedf = CursedF()
cursed = cursedf
k
print(cursed,cursed.add())

#

!e ```py
k=0
class CursedF(int):
def init(s):s.init=0;super().init()
def pow(s, n):
if not s.init:s+=n;s.init+=1;return s
else:return CursedF()int.pow(s,n)
def add(s,o=1):return super().add(o,self=s)
cursedf = CursedF()
cursed = cursedf
k
print(cursed,cursed.add())

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 9, in <module>
003 |   File "<string>", line 5, in __pow__
004 |   File "<string>", line 7, in __add__
005 | TypeError: wrapper __add__() takes no keyword arguments
floral meteor
#

AAAAAaaaaaaaAaaaaAAaAAAAAAAAAAAAAAAAAAAaa

#

Fuuuuuuuuyuuuuuuu7uuuuuu77juiyhjg7hirufihdhdjd9dhdhd
That means....
That I can't have an optional other argument in addition definition.

rugged sparrow
#

@floral meteor you can but super().__add__(o, self=s) is doing int.__add(o, self=s)

floral meteor
#

Oh.
Super syntax makes my brain hurt

#

!e ```py
k=0
class CursedF(int):
def init(s):s.init=0;super().init()
def pow(s, n):
if not s.init:s+=n;s.init+=1;return s
else:return CursedF()int.pow(s,n)
def add(s,o=1):return super().add(o)
cursedf = CursedF()
cursed = cursedf
k
print(cursed,cursed.add())

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 9, in <module>
003 |   File "<string>", line 5, in __pow__
004 | AttributeError: 'int' object has no attribute 'init'
sick hound
#
print(sum([j[k]for j in[[[r, m.append(list(l.split("= ")[1]))if"X"in l else r.update({l[l.index("[")+1:l.index("]")]:int("".join(map(lambda x:x[1] if x[1] !="X"else x[0],zip([["0"for i in range(len(m[-1])-len(n))]+list(n) for n in[bin(int(l.split("=")[1]))[2:]]][0],m[-1]))),2)})][0]for r in[{}]for m in[[]]for l in open("input.txt").read().split("\n")][0]]for k in j]))``` here's my shitty solution for one part of aoc lel
floral meteor
#

At least !e so we see what it does lel

sick hound
#

it needs an input file

#

lol

#

can you !e w/ an input file?

floral meteor
#

make a fake file

sick hound
#

if so how lmfao

floral meteor
#

I.e. redefine open to return a string from .read

night quarryBOT
#

Hey @sick hound!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

sick hound
#

ah faq

#

well that's the input

#

repl link actually

floral meteor
#

!e
So to start you off I'll show you the attributes your CursedOpen class needs to have...

dir(open("f.txt",'w'))
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 | OSError: [Errno 30] Read-only file system: 'f.txt'
floral meteor
#

Errr

#

Hack proof bot apparently

sick hound
#

lmfao

floral meteor
#

!e ```py
print(dir(open))

night quarryBOT
#

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

['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__text_signature__']
sick hound
#

whachu guys doing?

floral meteor
#

Hacking bot just hard enough to display the attributes of a file object

#

Nothing sinister,yet

#

!e ```py
print(open.class, open.new.code.co_consts)

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 | AttributeError: 'builtin_function_or_method' object has no attribute '__code__'
floral meteor
#

Bruh how does a built-in function or method not have a code attribute

#

!e ```py
import builtins as _
dir(_)

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 | ModuleNotFoundError: No module named '__builtins__'
floral meteor
#

Nice

#

Good bot security, actually

#

!e ```py
#first, sanity check:
print("<","@!","599422361166413824",">",sep="")

night quarryBOT
#

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

<@​!599422361166413824>
floral meteor
#

Lol

sudden willow
#

hold on

#

!e

night quarryBOT
#

@sudden willow :warning: Your eval job has completed with return code 0.

[No output]
sudden willow
#

hmmmm

#

perhaps it ignores backticks

terse mortar
#

No

sudden willow
#

!e

night quarryBOT
#

@terse mortar :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
#
# let's see how advanced this is...
print("`"*3,"<","@!","599422361166413824",">","`"*3,sep='')
night quarryBOT
#

@sudden willow :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
#

!e ```py

let's see how advanced this is...

print(""*3,"<","@!","599422361166413824",">",""*3,sep='')

night quarryBOT
floral meteor
#

NIIIIICE

sudden willow
#

damn

floral meteor
#

Thou shalt not escape looooooool

terse mortar
#

I realize this isn't #bot-commands lol

#

Mb

sudden willow
#

!e __import__("sys").os("ls")

night quarryBOT
#

@sudden willow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: module 'sys' has no attribute 'os'
sudden willow
#

oh

#

!e (__import__("sys").system("cd /etc/ && ls"))

night quarryBOT
#

@sudden willow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: module 'sys' has no attribute 'system'
sudden willow
#

whata

#

am i dumb

earnest wing
#

os

floral meteor
#

!e ```py

we are esoterically hacking bot lol

print("<","@!","599422361166413824",">",sep='',end=chr(27))

night quarryBOT
#

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

<@​!599422361166413824>
sudden willow
#

omfg

floral meteor
#

!e ```py
print(ord("\"))

sudden willow
#

!e (__import__("os").system("cd /etc/ && ls"))

night quarryBOT
#

@sudden willow :warning: Your eval job has completed with return code 0.

[No output]
sudden willow
#

??

night quarryBOT
#

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

92
floral meteor
#

!e ```py

we are esoterically hacking bot lol

print("<","@!","599422361166413824",">",sep='',end=chr(92))

night quarryBOT
#

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

<@​!599422361166413824>\
sudden willow
#

!e
_=["i love boys"] _=_.append(__**2)for __ in _)

floral meteor
#

bruh

night quarryBOT
#

@sudden willow :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     _=_.append(__**2)for __ in _)
003 |                      ^
004 | SyntaxError: invalid syntax
sudden willow
#

huh

floral meteor
#

Try +=

#

Idk

sudden willow
#

!e
_=["i love boys"] _=[_.append(__**2)for __ in _]

night quarryBOT
#

@sudden willow :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 2, in <listcomp>
004 | TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
floral meteor
#

Hmm

sudden willow
#

!e
_=["i love boys"] _=[_.append(__*2)for __ in _]

night quarryBOT
#

@sudden willow :warning: Your eval job timed out or ran out of memory.

[No output]
sudden willow
#

oomkiller πŸ”₯

floral meteor
#

!e ```py
print("`"*3)

night quarryBOT
floral meteor
#

!e print("","","",sep='',end='')

sudden willow
#

!e
print(chr(128)*3)

night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

€€€
sudden willow
#

hm

#

no output??

floral meteor
#

!e print("","","",sep='',end='')

night quarryBOT
#

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

[No output]
floral meteor
#

!e print(*['`']*2,sep='',end='')

night quarryBOT
#

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

``
sudden willow
#

!e
print("".join((chr(128)*3)))

night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

€€€
sudden willow
#

wtf

#

!e
print("".join((chr(128)*3), "test"))

night quarryBOT
#

@sudden willow :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: str.join() takes exactly one argument (2 given)
floral meteor
#

!e print(*['`']*2,sep='`',end='`')

night quarryBOT
#

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

[No output]
sudden willow
#

!e
print(chr(128)*3, "hi")

night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

€€€ hi
sudden willow
#

dafaque

floral meteor
#

@sudden willow character 127 is DEL

sudden willow
#

ah

#

whats backtick

floral meteor
#

!e print(ord("`"))

night quarryBOT
#

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

96
floral meteor
#

96

sudden willow
#

!e
print(chr(96)*3, "hi")

night quarryBOT
sudden willow
#

damn

#

!e
from os import system as s;s("ip address")

night quarryBOT
#

@sudden willow :warning: Your eval job has completed with return code 0.

[No output]
sudden willow
#

??????

#

what

floral meteor
#

Although I think the filter is

if '`'*3 in message.content: make_file(result); result=error_string("code_block_escape")
#

And the crazy modules like os are edited to return -1 instead if doing the stuff

#

I.e....

#

!e ```py
import('os').remove(file)

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 | NameError: name '__file__' is not defined
floral meteor
#

huh snek

#

!e ```py
import os
print(os.system(""))

night quarryBOT
#

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

-1
floral meteor
#

See?

sudden willow
#

damn

#

this is like the complete opposite of notsobot

#

in notsobot you can dump every file from it using .rex

#

including /etc/ data

floral meteor
#

!e ```py
print(globals())

night quarryBOT
#

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

{'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': None, '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>}
floral meteor
#

Aha

#

!e ```py
print(dir(globals().builtins))

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 | AttributeError: 'dict' object has no attribute '__builtins__'
floral meteor
#

Lol

tribal moon
#

do you mean dir(globals()["__builtins__"])

floral meteor
#

!e
print(dir(globals()['builtins']))

night quarryBOT
#

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

['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'ModuleNotFoundError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError', 'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError
... (truncated - too long)

Full output: https://paste.pythondiscord.com/nalamahefo.txt

tribal moon
#

ye I use globals for my obfuscation thing

#

really helpful

sick hound
#

can any one teach me how to connect my .py silent exploit to be reporting on my email ???

naive roost
#

not relevant here, and probably rule 5

#

!rule 5

night quarryBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious or inappropriate. Do not help with ongoing exams. Do not provide or request solutions for graded assignments, although general guidance is okay.

floral meteor
#

There's nothing really exploitable in there for bot hack

#

Could use the names of the errors to build strings tho

#

!e ```py
class cursed(int):
def add(s,o=1):return super().add(1)
haha=cursed(0)
print(haha)
haha=haha.add()
haha+=3
print(haha)

night quarryBOT
#

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

001 | 0
002 | 4
floral meteor
#

Wat

#

That should be 2

brittle pike
#

hello

floral meteor
#

A

night quarryBOT
#

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

001 | 0
002 | 2
brittle pike
#

im new

floral meteor
#

Yeah this is the advanced channel

brittle pike
#

ok

#

i want to get smarter

#

idk what to say now

floral meteor
#

Use your brain more, and it will get used to being used, and you will get smarter

brittle pike
#

but my understanding is bad

floral meteor
#

!e ```py
class cursed(int):
def add(s,o=1):return cursed(super().add(1))
haha=cursed(0)
print(haha)
haha=haha.add()
haha+=3
print(haha)β€Š
print(haha+)

night quarryBOT
#

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

001 |   File "<string>", line 7
002 |     print(haha)β€Š
003 |                ^
004 | SyntaxError: invalid non-printable character U+200A
floral meteor
#

Wat

brittle pike
#

ima go

floral meteor
#

!e ```py
class cursed(int):
def add(s,o=1):return cursed(super().add(1))
haha=cursed(0)
print(haha)
haha=haha.add()
haha+=3
print(haha)

brittle pike
#

bye

floral meteor
#

!e ```py
class cursed(int):
def add(s,o=1):return cursed(super().add(1))
haha=cursed(0)
print(haha)
haha=haha.add()
haha+=3
print(haha+)

night quarryBOT
#

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

001 |   File "<string>", line 7
002 |     print(haha+)
003 |                ^
004 | SyntaxError: invalid syntax
floral meteor
#

!e ```py
class cursed(int):
def add(s,o=1):return cursed(super().add(1))
haha=cursed(0)
print(haha)
haha=haha.add()
haha+=3
print(haha+...)

night quarryBOT
#

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

001 | 0
002 | 3
floral meteor
#

How do you syntax argumentless addition?

#

It tells me invalid syntax but if I chuck a placeholder in there it does what it needs to regardless of the placeholder

#

What I want to eventually do is exploit commas in arguments, funders including get item and get attribute to return lambdas to get...

k="" # input to the program. Alternatively define __ne__ attribute to bf!="<input>"
bf = Brainf**k # __pow__ is the new __init__
encoded_object = bf(# the following return bf objects with encoded lambdas
    bf+++++++++[ # input a list to the previous instruction to add a while loop
        bf>++++++++++<-"you could insert any python object here as comments"
    ]>. # getattr with no input arguments would print
)
print(str(encoded_object)) # string attribute would execute the instructions 
#

But unfortunately the syntax doesn't allow no b argument to a+b

#

Alright I guess I'll make a cursed English number system instead

snow beacon
floral meteor
#

Alright, I got this chunker that prints this, with yellow bars proportional to memory usage. You can input options as binary.
How to golf other than the obvious variable name shortening which is next todo.

def _rat_mat(n):
  r=n.as_integer_ratio()
  _={(r:=(int(r[0]/100000),int(r[1]/100000)))for _ in iter(lambda:r[0]>1000 and r[1]>1000,False)}
  a,b=r
  return[*[True]*a,*[False]*b]
class Maybe(int):
 r=__import__('random')
 def __new__(s,n:float=1.0):s.c=n>0 and _rat_mat(n)or(n<0 and _rat_mat(-1/n))or False;return s.r.choice(s.c)
import os,sys
def print_green(green=1,newlines=1,spaces=1,binary=1,monitor=1,sparse=1,smol=0,suppress_escape=1,*opts):
    now=(time:=__import__('time').time)();strain=0.0001
    try:os.system("")or{print(("".join([chr((spaces and Maybe(0.2+sparse) and 32)or(binary and Maybe(0.2+0.5*sparse)and(48+1*Maybe()))or sum([Maybe()and 2**j or 0 for j in range(7)]))for i in range(200-100*smol)]).translate(str.maketrans('','',''.join([chr(this)for this in range(2**5)])+''*suppress_escape)))[:~int(strain*100)][:os.get_terminal_size()[0]-10],end=green*'\x1b[0m'+(newlines*'\n')+monitor*(green*'\x1b[33m'+(strain:=-now+(now:=time())).__str__()[:6]+int(strain*100)*'|'*(not smol)+'\x1b[0m'*green))for p in iter(lambda:print(end='\x1b[32m'*green),True)}
    except KeyboardInterrupt:print('\x1b[0m')
    finally:print('\x1b[0m')
    return True
__name__=='__main__'and print_green(*[int(this)for this in input("\n[1111101]\nb>")])or(green_text:=(hexspam:=print_green))and(__doc__:="Make green text go brrrr")
#

actually, it might be cpu usage it's proportional to

#

if i shake my mouse it slows down

floral meteor
#

!e @snow beacon well yes, but a small issue with that...

print(0.1 .as_integer_ratio())
night quarryBOT
#

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

(3602879701896397, 36028797018963968)
floral meteor
#

plus I keep typing as_integer_ratio as as_integer_ration so that adds a backspace i have to type

#

!e I could try...

from math import ceil
f=0.1
a,b = f.as_integer_ratio()
a,b = int(a),ceil(b*f)//f
print((a/b).as_integer_ratio())
night quarryBOT
#

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

(3602879701896397, 36028797018963968)
floral meteor
#

but that's the same

#

!e ```py
from math import ceil
f=0.1
a,b = f.as_integer_ratio()
a,b = int(a),ceil(b*f)//f
print(a,b,sep='/',end='=')
print((a/b).as_integer_ratio())

night quarryBOT
#

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

3602879701896397/3.602879701896397e+16=(3602879701896397, 36028797018963968)
rugged sparrow
#

you can use float.__ceil__ instead of importing from math

floral meteor
#

oh cool

#

!e ```py
f=0.1
a,b = f.as_integer_ratio()
a,b = int(a),(b*f).ceil()//f
print(a,b,sep='/',end='=')
print((f:=a/b))
print(f.as_integer_ratio())

night quarryBOT
#

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

001 | 3602879701896397/3.602879701896397e+16=0.1
002 | (3602879701896397, 36028797018963968)
floral meteor
#

bruh where's the -2 come from?

snow beacon
floral meteor
#

I'm working with probability I don't need flippity floppity funny looking when I can have (1, 10)

sudden willow
#

generated using my obfuscator

#

!e

"cityshow#0822";(eval("'trollar'"));(eval("'trollar'"));(eval("'trollar'"))
(__import__("base64").b64decode("InN0b3AgdHJ5aW5nIHRvIGNyYWNrIHRoaXMgc2tpZCI="))
_very_real_constant=(__import__("base64").b64decode("InRyb2xlZCI="));_=True.__int__()
(__import__("codecs").decode("uggcf://zrqvn.qvfpbeqncc.arg/nggnpuzragf/781621755261353995/802537966877933578/vzntr0.wct", "rot13"))
True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True.__add__(True))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));"troled"
eval(chr(112)+chr(114)+chr(105)+chr(110)+chr(116)+chr(40)+chr(34)+chr(72)+chr(101)+chr(108)+chr(108)+chr(111)+chr(44)+chr(32)+chr(87)+chr(111)+chr(114)+chr(108)+chr(100)+chr(33)+chr(34)+chr(41)+chr(10)+"")
global trollar;global trollar;global trollar;global trollar;global trollar;global trollar;global trollar;global trollar;global trollar;global trollar;(chr(int(ord(str(True)[0])).__sub__((True.__int__().__add__(True.__int__()).__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__mul__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True))))))))))))
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
snow beacon
#

(1, 10) isn't esoteric enough for.my tastes.

rugged sparrow
#

!e py print(0.1.as_integer_ratio())

night quarryBOT
#

@rugged sparrow :white_check_mark: Your eval job has completed with return code 0.

(3602879701896397, 36028797018963968)
floral meteor
#

!e ```py
n=0.1
r=n.as_integer_ratio()
_={(r:=(int(r[0]/1000),int(r[1]/1000)))for _ in iter(lambda:r[0]>1000 and r[1]>1000,False)}
a,b=r
print(n,end='=')
print(a,b,sep='/')

night quarryBOT
#

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

0.1=3/36
sudden willow
floral meteor
#

obfuscation by distraction

snow beacon
sudden willow
#

i mean that works too

sudden willow
#

!e
eval(chr(112)+chr(114)+chr(105)+chr(110)+chr(116)+chr(40)+chr(34)+chr(72)+chr(101)+chr(108)+chr(108)+chr(111)+chr(44)+chr(32)+chr(87)+chr(111)+chr(114)+chr(108)+chr(100)+chr(33)+chr(34)+chr(41)+chr(10)+"")

night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
floral meteor
#

output not input

snow beacon
#

If you want to round something with a big denominator to a neater fraction, probably continued fractions are the way to go.

floral meteor
#

actually...
monke think...

#

!e
Okay i forgot what I was doing halfway through writing it...

n=0.1
r=n.as_integer_ratio()
_={(r:=(int(str(r[0])[:~((len(str(n-n//1))or 2)-2)]),int(str(r[1])[:~((len(str(n-n//1))or 2)-2)])))for _ in iter(lambda:r[0]>1000 and r[1]>1000,False)}
a,b=r
print(n,end=' = ')
print( r, sep='/')
night quarryBOT
#

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

0.1 = (36, 360)
floral meteor
#

hey! it works! sort of... almost... i just need to add a bit of...

sudden willow
#

made my obfuscation algorithm convert all + to .__add__ aswell

night quarryBOT
#
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.

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

#

Hey @sudden willow!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

sudden willow
#

oh damn

#

!e

# main function
eval(chr(112).__add__(chr(114).__add__(chr(105).__add__(chr(110).__add__(chr(116).__add__(chr(40).__add__(chr(34).__add__(chr(72).__add__(chr(101).__add__(chr(108).__add__(chr(108).__add__(chr(111).__add__(chr(44).__add__(chr(32).__add__(chr(87).__add__(chr(111).__add__(chr(114).__add__(chr(108).__add__(chr(100).__add__(chr(33).__add__(chr(34).__add__(chr(41).__add__(chr(10).__add__(""))))))))))))))))))))))))
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
floral meteor
#

!e
okay, now how do I find common factors other than each other?

n=0.1
r=n.as_integer_ratio()
_={(r:=(int(str(r[0])[:~((len(str(n-n//1))or 2)-2)]),int(str(r[1])[:~((len(str(n-n//1))or 2)-2)])))for _ in iter(lambda:r[0]>1000 and r[1]>1000,False)}
r=((r[1]//r[0])*r[0]==r[1])and(1,r[1]//r[0])or(r[0],r[1])
print(n,end=' = ')
print(*r, sep='/')
night quarryBOT
#

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

0.1 = 1/10
floral meteor
#

what if i floor_div'd both sides by 9?

plucky wedge
#

Lenny, how do U make these esoteric things? I always look at this channel and see u big braining

floral meteor
#

oh that reminds me I had a thonk last night...

floral meteor
#

!e ```py
class Cursed(int):
def init(s,a,b=0):s.i=b;super().init(a)
mul=lambda s,n:Cursed(super().mul(n),s.i)
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n))
add=lambda s,n:Cursed(int.sub(s,n),s.i)
neg=lambda s:Cursed(0,s.i)+s
and=lambda s,n:Cursed(s)-n
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1);billion=million
thousand;trillion=billion*thousand
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19)
twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90)
print(one-thousand-five-hundred and twenty-seven)

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 8, in <module>
003 | ValueError: int() base must be >= 2 and <= 36, or 0
floral meteor
#

!e ```py
class test(int):
def init(s,n):print(s,n)
test(4)

night quarryBOT
#

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

4 4
floral meteor
#

wtf

#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0])
def new(s,
):s.i=len()>1 and _[1]or 0;return _[0]
mul=lambda s,n:Cursed(super().mul(n),s.i)
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n))
add=lambda s,n:Cursed(int.sub(s,n),s.i)
neg=lambda s:Cursed(0,s.i)+s
and=lambda s,n:Cursed(s)-n
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1);billion=million
thousand;trillion=billion*thousand
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19)
twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90)
print(one-thousand-five-hundred and twenty-seven)

night quarryBOT
#

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

13
floral meteor
#

...

terse mortar
#

lol nice

floral meteor
#

1527 != 13 but at least it's not erroring...

#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0])
def new(s,
):s.i=len()>1 and _[1]or 0;return _[0]
mul=lambda s,n:Cursed(super().mul(n),s.i)
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n))
add=lambda s,n:Cursed(int.sub(s,n),s.i)
neg=lambda s:Cursed(0,s.i)+s
and=lambda s,n:Cursed(s)-n
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1);billion=million
thousand;trillion=billion*thousand
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19)
twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90)
print(one-thousand)

night quarryBOT
#

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

-999
floral meteor
#

sub doesn't even work lol

#

!e ```py
class test(int):
def sub(_,n):return test(super().add(n))
print(test(3)-5)

night quarryBOT
#

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

8
floral meteor
#

that worked

#

bruh how is there another string override?

#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0])
def new(s,
):s.i=len()>1 and _[1]or 0;return _[0]
mul=lambda s,n:Cursed(super().mul(n),s.i)
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n))
add=lambda s,n:Cursed(int.sub(s,n),s.i)
neg=lambda s:Cursed(0,s.i)+s
and=lambda s,n:Cursed(s)-n
str=lambda s:f"Cursed {'One-'s.i}{super(s,int).str()}"
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1);billion=million
thousand;trillion=billion
thousand
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19)
twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90)
print(one,thousand)

night quarryBOT
#

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

1 1000
floral meteor
#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0])
def new(s,
):s.i=len()>1 and _[1]or 0;return _[0]
mul=lambda s,n:Cursed(super().mul(n),s.i)
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n))
add=lambda s,n:Cursed(int.sub(s,n),s.i)
neg=lambda s:Cursed(0,s.i)+s
and=lambda s,n:Cursed(s)-n
def str(s):return "Cursed "+"One-"s.i+super().str()
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1);billion=million
thousand;trillion=billion
thousand
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19)
twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90)
print(str(one),str(thousand))

night quarryBOT
#

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

1 1000
broken mesa
#

its because you return _[0] i think

floral meteor
#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0])
def new(s,
):s.i=len()>1 and _[1]or 0;return s
mul=lambda s,n:Cursed(super().mul(n),s.i)
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n))
add=lambda s,n:Cursed(int.sub(s,n),s.i)
neg=lambda s:Cursed(0,s.i)+s
and=lambda s,n:Cursed(s)-n
str=lambda s:"Cursed "+"One-"s.i+super().str()
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1);billion=million
thousand;trillion=billion
thousand
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19)
twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90)
print(one.str(),thousand.str())

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 | TypeError: unsupported operand type(s) for *: 'type' and 'type'
floral meteor
#

problem is i get that error when returning s

broken mesa
#

well

#

s is you class

floral meteor
#

so I gotta return s.init()?

broken mesa
#

you need to return a instance from __new__afaik

floral meteor
#

but that is new

#

what does it evaluate first, new or init?

broken mesa
#

__new__ is the first method to get called in an object's instantiation. It takes the class, then any other arguments that it will pass along to __init__.

floral meteor
#

now what?

broken mesa
#

hmm

floral meteor
#

oh

#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0]) # 2
def new(s,
):s.i=len()>1 and [1]or 0;return s.init(*) # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:Cursed(s)-n # 8
str=lambda s:"Cursed "+"One-"s.i+super().str() # 9
hundred=Cursed(100,1);print(hundred);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=million
thousand;trillion=billion
thousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(one.str(),thousand.str()) # 13

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 |   File "<string>", line 3, in __new__
004 |   File "<string>", line 2, in __init__
005 | AttributeError: 'int' object has no attribute 'i'
broken mesa
#

!e ```py
class myint(int):
def init(self, val):
self.val = val

def __new__(cls, val):
    return super().__new__(cls, val)

print(type(myint(5)), myint(5))

night quarryBOT
#

@broken mesa :white_check_mark: Your eval job has completed with return code 0.

<class '__main__.myint'> 5
broken mesa
#

@floral meteor this is a normal way to subclass int

#

maybe you can adjust yours to work similarily

#

ive tried on my end but you supply 1 as a second arg sometimes wich wont work as a base for int

#

you need to call super().__new__ not init

floral meteor
#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0]) # 2
new=lambda c,
:super().new(c,*) # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(sn)or Cursed(int.add(s,n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:Cursed(s)-n # 8
str=lambda s:"Cursed "+"One-"s.i+super().str() # 9
hundred=Cursed(100,1);print(hundred);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=million
thousand;trillion=billion
thousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(one.str(),thousand.str()) # 13

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 |   File "<string>", line 3, in <lambda>
004 | ValueError: int() base must be >= 2 and <= 36, or 0
broken mesa
#

i got that same error

floral meteor
#

why does it interpret it as base?

broken mesa
#

second arg to int

#

is base

floral meteor
#

how does it manage to reverse override my second arg?

broken mesa
#

!e int(100, 1)

night quarryBOT
#

@broken mesa :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ValueError: int() base must be >= 2 and <= 36, or 0
broken mesa
#

thats the same as Cursed(100,1)

#

since you pass the args to super

floral meteor
#

but I only pass n from int(n)
as s is already passed, hence super().__init__(n) should take the default base argument

#

!e ```py
print(int("42",0))

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 | TypeError: int() can't convert non-string with explicit base
broken mesa
#

i think when you call super.new it calls int.init not Cursed.init

#

any particular reason for subclassing int?

floral meteor
#

!e ```py
class Cursed(int):
def init(s,):s.i=len()>1 and [1]or 0;super().init([0]) # 2
new=lambda c,
:(s:=super().new(c,*))and Cursed.init(s,_) # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:(s.i or isinstance(n,Cursed)and n.i)and Cursed(s
n)or Cursed(int.add(s,n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:Cursed(s)-n # 8
str=lambda s:"Cursed "+"One-"s.i+super().str() # 9
hundred=Cursed(100,1);print(hundred);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=million
thousand;trillion=billion*thousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(one.str(),thousand.str()) # 13

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 |   File "<string>", line 3, in <lambda>
004 | ValueError: int() base must be >= 2 and <= 36, or 0
floral meteor
#

Well, since I'm overriding all the methods I'm using it's kinda pointless isn't it?

#

its like an integer but not

broken mesa
#

you wouldn't even need new if it was a normal object

floral meteor
#

I'd need an __int__ attribute tho

broken mesa
#

can just add that yourself?

floral meteor
#

and I'd need to use s.val instead of s

broken mesa
#

hmm

#

no wait

#

idea

#

just do whatver you do in the init, in new instead

floral meteor
#

i think i tried that already and got has no attirbute i..
i'll try it again tho

broken mesa
#

you need to make a instance using the super call first

#

methinks

#

whats the second arg (of Cursed) supposed to mean anyways?

floral meteor
#

the second arg is meant to make one-hundred evaluate as 1*100 instead of 1+100

rugged sparrow
#

__new__ needs to return s

#

not return __init__

floral meteor
#

niiiiiice

#

wait

#

!e ```py
class Cursed(int):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:"Cursed "+super().str() # 9
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=millionthousand;trillion=billionthousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(four-hundred and twenty) # 13

night quarryBOT
#

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

Cursed 20
floral meteor
#

oh I see what's wrong

#

__and__ dunder doesn't work

#

!e ```py
class test(int):
and=lambda s,n:s+n
print(test(1) and test(2))
print(test(1)&test(2))

night quarryBOT
#

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

001 | 2
002 | 3
floral meteor
#

i see

broken mesa
#
__and__(self, other)
    Implements bitwise and using the & operator.
floral meteor
#

I can't use the and keyword then

#

!e ```py
class Cursed(int):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:"Cursed "+super().str() # 9
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=millionthousand;trillion=billionthousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(four-hundred & twenty) # 13

night quarryBOT
#

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

Cursed 420
broken mesa
#

yes you cant override the and or not boolean operators

#

soo ye

#

sad

floral meteor
#

but i can override __bool__ itself

broken mesa
#

lemme redefine keywords please

floral meteor
#

although not cursed_boolean would still return a boolean regardless

#

unless...

#

nope.

broken mesa
#

TypeError: __bool__ should return bool, returned int

#

sad

floral meteor
#

very

broken mesa
#

now im thinking about eso python i wanna finish my functions-are-actual-classes thing

#

ree

floral meteor
#

yeah i thought that a bit

#

!e ```py
class my_func:
def init(*args):print(*args)
my_func(4)
def my_func(*args):print(*args)
my_func(4)

night quarryBOT
#

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

001 | <__main__.my_func object at 0x7f5dc7d4efd0> 4
002 | 4
floral meteor
#

!e ```py
class Cursed(int):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:"Cursed "+super().str() # 9
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=millionthousand;trillion=billionthousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(eight-thousand-five-hundred & twenty-seven) # 13

night quarryBOT
#

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

Cursed 800527
floral meteor
#

that's eight hundred thousand

#

oh no...

#

!e ```py
class Cursed(int):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:"Cursed "+super().str() # 9
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=millionthousand;trillion=billionthousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(eight-thousand & five-hundred & twenty-seven) # 13

night quarryBOT
#

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

Cursed 8527
floral meteor
#

!e ```py
class Cursed(int):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:"Cursed "+super().str() # 9
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=millionthousand;trillion=billionthousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(eight-hundred-thousand & four) # 13

night quarryBOT
#

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

Cursed 800004
broken mesa
#

i kind of like it

#

idk why

floral meteor
#

ty

#

!e even more applicable is if i did a small tweak... ```py
class Cursed(int):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=millionthousand;trillion=billionthousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
print(eval("eight-thousand & five-hundred & twenty-seven")) # 13

night quarryBOT
#

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

8527
floral meteor
#

now, for float implementation...

#

unfortunately there's no obvious point keyword

rugged sparrow
#

@floral meteor just do num.decimal

#

as an attribute

#

so like one.two is 1.2

broken mesa
#

oh true

floral meteor
#

ah, but then I'd have to call it

#

unless...

#

I made it return another version of the Cursed class

rugged sparrow
#

just define a __getattr__

floral meteor
#

oh, k

rugged sparrow
#

you will need to figure out a way to handle operator precedence tho

broken mesa
#

idea: make the class bootstrap itself by adding instances to global scope in a classmethod

floral meteor
#

!e ```py
class haha:
def init(s,i):s.i=i
def getattr(s,n=0):return s.i[n]
haha([3,4,5]).5

night quarryBOT
#

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

001 |   File "<string>", line 4
002 |     haha([3,4,5]).5
003 |                  ^
004 | SyntaxError: invalid syntax
floral meteor
#

aww

broken mesa
#

that way you could simultaneously store the instances in the class for usage in getattr

rugged sparrow
#

yea attributes need to be valid identifiers

floral meteor
#

!e ```py
class haha:
def init(s,i):s.i=i
def getattr(s,n="a0"):return s.i[int(n.strip('a'))]
print(haha([3,4,5]).a2)

broken mesa
#

no print

night quarryBOT
#

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

5
floral meteor
#

huh, so... modified version...

broken mesa
#

i got it

#

!e ```py
class Cursed(int):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:"Cursed "+super().str() # 9

def getattr(s, k):
return s.stuff[k]
@classmethod
def bootstrap():
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=millionthousand;trillion=billionthousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
_.stuff = locals()
globals().update(locals())
Cursed._bootstrap()
print(hundred.thousand)

night quarryBOT
#

@broken mesa :white_check_mark: Your eval job has completed with return code 0.

Cursed 1000
broken mesa
#

well

#

not decimal yet

#

but proof of concept

#

@floral meteor what you think?

#

cursed enough?

#

updating globals with locals is next level cursedness

#

i might have to use that more

#

HAH I GOT INSTANCES PROPERLY PASSING IN MY FUNC CLASSES

#

yesssss

floral meteor
#

!e ```py
class Cursed(float):
def gatattr(s,a):
if s.k:eval(f"{s}.{a}")
else:s.k=1;return Cursed(s-eval(a),d=1)
def init(s,a,d=0):super().init() # 2
def new(c,a,b=0,d=0):s=super().new(c,a);s.i=b;s.k=d;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i,d=isinstance(n,float)) # 4
def sub(s,n):
if not s.k:return Cursed((isinstance(n,Cursed)and n.i)and s
n or int.add(Cursed(s),n))
else:s.k/=10;return Cursed(float.add(s,eval(str(n))s.k))
add=lambda s,n:Cursed(int.sub(s,n),s.i) # 6
neg=lambda s:Cursed(0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:s.k and super().str()or int.str(s) # 9
@classmethod
def bootstrap():
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
billion=million
thousand;trillion=billion*thousand # 11
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
globals().update(locals())
Cursed._bootstrap()
print(eight-thousand & five-hundred & twenty-seven.three) # 13

broken mesa
#

yea those are indented into the bootstrap method ofc

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 22, in <module>
003 | AttributeError: 'Cursed' object has no attribute 'three'
broken mesa
#

you need to store the locals in the class like i did

#

_.stuff = locals()

#

i store them in stuff

floral meteor
#

!e
about 4

class Cursed(float):
  def __gatattr__(s,a):
    if s.k:raise SyntaxError
    else:s.k=1;return Cursed(s-eval(a),d=1)
  def __init__(s,*a,d=0):super().__init__() # 2
  def __new__(c,a,b=0,d=0):s=super().__new__(c,a);s.i=b;s.k=d;return s # 3
  __mul__=lambda s,n:Cursed(super().__mul__(n),s.i,d=isinstance(n,float)) # 4
  def __sub__(s,n):
    if not s.k:return Cursed((isinstance(n,Cursed)and n.i)and s*n or int.__add__(Cursed(s),n))
    else:s.k/=10;return Cursed(float.__add__(s,eval(str(n))*s.k))
  __add__=lambda s,n:Cursed(int.__sub__(s,n),s.i) # 6
  __neg__=lambda s:Cursed(0,s.i)+s # 7
  __and__=lambda s,n:s-n # 8
  __str__=lambda s:s.k and super().__str__()or int.__str__(s) # 9
  @classmethod
  def _bootstrap(_):
    hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 10
    billion=million*thousand;trillion=billion*thousand # 11
    one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 12
    _.stuff=locals()
    globals().update(locals())
Cursed._bootstrap()
print(eight-thousand & five-hundred & twenty-seven.three) # 13
night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 23, in <module>
003 |   File "<string>", line 13, in <lambda>
004 |   File "<string>", line 9, in __sub__
005 | TypeError: descriptor '__add__' requires a 'int' object but received a 'Cursed'
broken mesa
#

only 4? but i define a method for a function!

floral meteor
#

ye

broken mesa
#

i bet the number would go up if i showed how i do this

floral meteor
#

mebbe 5

broken mesa
#

hmm

#

what would you rate "Cursed"?

floral meteor
#

since we can't yet figure out how to make it like a float, probs 3

broken mesa
#

i mean, i haven't figured out magic methods either

#

probably cant

#

without actually converting it to a class

#

which would be easy in comparison

#

and cheating

rugged sparrow
#

it is a class rn tho?

broken mesa
#

im referring to my thing

floral meteor
#

NotImplementedType

#

why is it ```https
NotImplemented

rugged sparrow
#

ahh ok

sudden willow
#

!e

print(chr(ord(True.__str__()[0]).__sub__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__()))))))))))))).__add__(chr(ord(True.__str__()[1]).__sub__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True.__int__().__add__(True))))))))))))))).__add__((....__class__().__str__())[2]).__add__(....__class__().__str__()[2]).__add__(chr(ord(True.__str__()[1]).__sub__(True.__int__().__add__(True.__int__().__add__(True.__int__()))))))
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

Hello
sudden willow
#

took a good 30 minutes to code

floral meteor
#

!e ```py
class Cursed(float):
def init(s,a):super().init() # 2
def new(c,a,b=0):s=super().new(c,a);s.i=b;return s # 3
mul=lambda s,n:Cursed(super().mul(n),s.i) # 4
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or isinstance(n,float)and(float.add(s,n))or int.add(Cursed(s),n)) # 5
add=lambda s,n:Cursed(super().sub(n),s.i) # 6
neg=lambda s:Cursed(0.0,s.i)+s # 7
and=lambda s,n:s-n # 8
str=lambda s:super().str() # 9
def getattr(s, k):return Cursed(eval(str(s))+s.stuff[k]0.1) # 10
@classmethod
def bootstrap():
hundred=Cursed(100,1);thousand=Cursed(1000,1);million=Cursed(1000000,1) # 13
billion=million
thousand;trillion=billion*thousand # 14
one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=Cursed(1),Cursed(2),Cursed(3),Cursed(4),Cursed(5),Cursed(6),Cursed(7),Cursed(8),Cursed(9),Cursed(10),Cursed(11),Cursed(12);thirteen,forteen,fifteen,sixteen,seventeen,eighteen,nineteen=Cursed(13),Cursed(14),Cursed(15),Cursed(16),Cursed(17),Cursed(18),Cursed(19);twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=Cursed(20),Cursed(30),Cursed(40),Cursed(50),Cursed(60),Cursed(70),Cursed(80),Cursed(90) # 15
_.stuff = locals() # 16
globals().update(locals()) # 17
Cursed._bootstrap() # 18
print(one-hundred & three.seven) #19

#

lol

broken mesa
night quarryBOT
#

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

103.7
floral meteor
#

wow that works

broken mesa
#

nice

floral meteor
#

but only for one decimal place

sudden willow
#

had alot of eof errors

floral meteor
broken mesa
#

what score?

#

number of linter errors?

floral meteor
#

ye

broken mesa
#

hmm

floral meteor
#

that's the esoteric score, sΓ­?

broken mesa
#

i mean not really?

floral meteor
#

I mean really, considering the more weak warnings there are, generally the more esoteric the code is

broken mesa
floral meteor
#

it's proportional

#

but it returns None

broken mesa
#

no it returns a instance of itself

floral meteor
#

Have you seen my esoterically written basic resmon?

broken mesa
#

monkey-patched into it with the @init decorator

#

nope

floral meteor
#
def _rat_mat(n):
  r=n.as_integer_ratio()
  _={(r:=(int(r[0]/100000),int(r[1]/100000)))for _ in iter(lambda:r[0]>1000 and r[1]>1000,False)}
  a,b=r
  return[*[True]*a,*[False]*b]
class Maybe(int):
 r=__import__('random')
 def __new__(s,n:float=1.0):s.c=n>0 and _rat_mat(n)or(n<0 and _rat_mat(-1/n))or False;return s.r.choice(s.c)
import os,sys
def print_green(green=1,newlines=1,spaces=1,binary=1,monitor=1,sparse=1,smol=0,suppress_escape=1,*opts):
    now=(time:=__import__('time').time)();strain=0.0001
    try:os.system("")or{print(("".join([chr((spaces and Maybe(0.4+sparse) and 32)or(binary and Maybe(0.2+0.5*sparse)and(48+1*Maybe()))or sum([Maybe()and 2**j or 0 for j in range(7)]))for i in range(200-100*smol)]).translate(str.maketrans('','',''.join([chr(this)for this in range(2**5)])+''*suppress_escape)))[:~int(strain*100)][:os.get_terminal_size()[0]-10],end=green*'\x1b[0m'+(newlines*'\n')+monitor*(green*'\x1b[33m'+(strain:=-now+(now:=time())).__str__()[:6]+int(strain*100)*'|'*(not smol)+'\x1b[0m'*green))for p in iter(lambda:print(end='\x1b[32m'*green),True)}
    except KeyboardInterrupt:print('\x1b[0m')
    finally:print('\x1b[0m')
    return True
__name__=='__main__'and print_green(*[int(this)for this in input("\n[1111101]\nb>")])or(green_text:=(hexspam:=print_green))and(__doc__:="Make green text go brrrr")
#

If i move the cursor erratically around the screen, it slows it down and extends the yellow bars. Same as if i resize a window or start a process

broken mesa
#

i like

floral meteor
#

ty, init takes binary arguments to switch features on or off

broken mesa
#

but back to what we were talking about previously: i dont think linter errors are a proper measurement for esotericness of code

floral meteor
#

well, they measure 'not following pep-8'

#

so they're at least proportional

broken mesa
#

its about the extremes of bad practices you use, not the amount of pep 8 infringements.

#

i could write very non-esoteric code that breaks pep8 a thousand times

#

simply by printing a thousand strings that are longer than 79 characters

floral meteor
#

and the yellow bars are proprotional to how long it takes to print that with extra spaces, 1s and 0s

#

and formatted green

#

and themselves

#

and the former chopped to allocate room for the yellow text and to keep within terminal size

#

sometimes it manages to undergo two cycles in less than 0.0001 time, in which case it displays as 0.0

#

I could probably make a version that instead of printing green text, it clears the screen each cycle, and displays miscellaneous bars for different processes

twin hull
#

is there any pep discussing the non-isolation of private datatypes?

last locust
twin hull
#

alright πŸ™‚

sharp ice
#

what code do i use to compute all multiples of 3, 5 that are less than 100 in python??

twilit grotto
#

that sounds like a terribly worded fizzbuzz

frozen holly
#

my very lazy solution

#

!e ```py
print(list(dict.fromkeys(sorted([i for i in range(0, 100, 3)]+[i for i in range(0, 100, 5)]))))

night quarryBOT
#

@frozen holly :white_check_mark: Your eval job has completed with return code 0.

[0, 3, 5, 6, 9, 10, 12, 15, 18, 20, 21, 24, 25, 27, 30, 33, 35, 36, 39, 40, 42, 45, 48, 50, 51, 54, 55, 57, 60, 63, 65, 66, 69, 70, 72, 75, 78, 80, 81, 84, 85, 87, 90, 93, 95, 96, 99]
proper vault
#

I would just do

print([n for n in range(100) if (n % 3) * (n % 5) == 0])
snow beacon
#

print([n for n in range(100) if n%15 in b'\x00\x03\x05\x06\t\n\x0c'])

night quarryBOT
#

@rugged sparrow :white_check_mark: Your eval job has completed with return code 0.

<frame at 0x7f04c22fe740, file '<string>', line 12, code <module>>
rugged sparrow
#

works the same as sys._getframe without needing an import

earnest wing
#

don't remember the exact semantics for octal escapes

snow beacon
#

I just printed the bytes I wanted.

#

Maybe \N escapes would be best.

sudden willow
#

!e

_=[print(....__class__().__str__()[_]) for _ in range(len(....__class__().__str__))]
night quarryBOT
#

@sudden willow :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: object of type 'method-wrapper' has no len()
sick hound
#

!e

_=[print(....__class__().__str__()[_]) for _ in range(len(....__class__().__str__()))]
night quarryBOT
#

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

001 | E
002 | l
003 | l
004 | i
005 | p
006 | s
007 | i
008 | s
sick hound
#

fixed ur welcome @sudden willow

sudden willow
#

@sick hound thx

sick hound
#

@sick hound how tf does that work

#

its very easy

#

also not my code

#

ask cityshow

#

I understand most of it

#

but what are the 4 dots before __class

arctic wraith
sick hound
#

ah

floral meteor
#

!e ```py
enigma_en=lambda s,k:{k:(k:=len(s)<len(k)and key[:len(s)]or len(s)>len(k)and(k*(len(s)//len(k)+1))[:len(s)]or k),k:(_s:=[ord(c)for c in list(s)]),k:(k:=[ord()for _ in list(k)]),k:[(_p:=[]),{_p.append((((-32)+(k[]-32))%95)+32)for , in enumerate(s)}],k:s.class().join([chr()for _ in _p])}[k]
print((_6:=enigma_en("haha password go brrrrrr","Password1")))
enigma_de=lambda s,k:{k:(k:=len(s)<len(k)and key[:len(s)]or len(s)>len(k)and(k*(len(s)//len(k)+1))[:len(s)]or k),k:(_s:=[ord(c)for c in list(s)]),k:(k:=[ord()for _ in list(k)]),k:[(_p:=[]),{_p.append((((
-32)-(k[]-32))%95)+32)for , in enumerate(s)}],k:s.class().join([chr()for _ in _p])}[k]
print(enigma_de(_6,"Password1"))
print(enigma_de(_6,"wrong password"))

night quarryBOT
#

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

001 | 9C\Uw`TX%HQfXwWbdsCTffjb
002 | haha password go brrrrrr
003 | APlf0`cv1TYve3_ot%[Tu%vn
floral meteor
#

I should throw this in my cursed module and curse it a bit

floral meteor
#

alright I just made this, but I feel like there's some holes in the security

class Enigma(object):
 enigma_en=lambda _6,s,k:{k:(k:=len(s)<len(k)and k[:len(s)]or len(s)>len(k)and(k*(len(s)//len(k)+1))[:len(s)]or k),k:(_s:=[ord(c)for c in list(s)]),k:(_k:=[ord(_)for _ in list(k)]),k:[(_p:=[]),{_p.append((((__-32)+(_k[_]-32))%95)+32)for _,__ in enumerate(_s)}],k:s.__class__().join([chr(_)for _ in _p])}[k]
 enigma_de=lambda _6,s,k:{k:(k:=len(s)<len(k)and k[:len(s)]or len(s)>len(k)and(k*(len(s)//len(k)+1))[:len(s)]or k),k:(_s:=[ord(c)for c in list(s)]),k:(_k:=[ord(_)for _ in list(k)]),k:[(_p:=[]),{_p.append((((__-32)-(_k[_]-32))%95)+32)for _,__ in enumerate(_s)}],k:s.__class__().join([chr(_)for _ in _p])}[k]
 def __init__(_,s='',k=''):_._k=k;_._s=s
 __str__=lambda _:_.enigma_en(_._s,_._k)
 __getattribute__=__getattr__=lambda _,n:n in['enigma_en','enigma_de','__str__']and super().__getattribute__(n)or n
 __setattr__=lambda _,n,s:int(not (n in['key','password']and[super().__setattr__('_k',s),1][1]or n in['source','token']and[super().__setattr__('_k',s),1][1]or 0))
 detokenise=lambda _,s:s.replace(_._s,:"<token>")
 retokenise=lambda _,s:s.replace("<token>",._._s)
floral meteor
#

@broken mesa
I have figured out how to implement and in natural syntax for numbers, but i don't have time rn to make it.
essentially, I would create a CursedCore class to store data, with a value attribute initialised at 0 and a get_value method that reinitialises it when it returns the value, then I would do cc = CursedCore() and pass cc as an argument to the Cursed objects, then i'll define __bool__ such that the value of the Cursed object is added to cc.value, then __str__(self) would return self-self.cc.get_value().
so...

print(str(
    four-hundred and twenty
))

would first evaluate four-hundred 4*100 then bool(result) would add 400 to cc.value, and return True to the and, so that twenty 20 gets evaluated. Then the expression is 'stringed' which would add cc.value to twenty, reset cc.value, and return the string of the new value, '420' to the print function

#

big brain go brrrrr

tired anvil
#

Sure itll stop the average user, but for people who'd be diving into it in the first place its just an extra few steps

sick hound
#

@dull anvil I pinged you here because it's not really something that you should do in Python, but here is a way to have it sum up values without globals:

import inspect
import copy

def chain_sum(val=None):
    self = globals()[inspect.stack()[0][3]]

    if val is None:
        result = self._val_
        self._val_ = 0
        return result
    
    if not hasattr(self, "_val_"):
        setattr(self, "_val_", val)
        return self
    else:
        self._val_ += val
        return self

print(chain_sum(5)(3)(6)())
print(chain_sum(5)(3)(8)())
dull anvil
#

ooooh

sick hound
#

the _val_ attribute should really be added before the function is even called, but I wanted it to be self-contained

dull anvil
#

ah got it

thin trout
#

because it's not really something that you should do in Python
I’ve seen worst production code haha

sick hound
#

Maybe with some even more hacky code one could introspect when the chain ends

#

So the last function call with the empty argument isn't necessary

proper vault
#
def chain_sum(n):
    def summer(m=None):
        if m is None:
            return n
        else:
            return chain_sum(n+m)
    return summer
``` seems like an easier implementation
sick hound
#

Yeah, this is definitely better

sick hound
#

Hmm, can anyone think of a good way to make it work without the terminating empty argument?

proper vault
#
class chain_sum(int):
    def __call__(self, other):
        return chain_sum(self + other)
#

though this wouldn't work with arbitrary objects, only with ints

sick hound
#

Oh this is great

#

Here's my extremely ungodly solution ```py
import inspect
import linecache

def chain_sum(val):
self_name = inspect.stack()[0][3]

caller_frame = inspect.getframeinfo(inspect.stack()[1][0])
caller_lineno = caller_frame.lineno
caller_filename = caller_frame.filename
calling_line = linecache.getline(caller_filename, caller_lineno)

if calling_line.count(self_name) != 1:
    raise SyntaxError("This function can't be called more than once per line.")

idx = calling_line.index(self_name) + len(self_name)

calls_amount = 0
nest = 0

for c in calling_line[idx:]:
    if c == "(":
        if nest == 0: calls_amount += 1
        nest += 1

    elif c == ")":
        nest -= 1
        if nest == -1: break

    if nest == 0 and c not in "() ":
        break

def chain_sum(n, depth):
    if depth == 0:
        return n
    
    def summer(m):
        return chain_sum(n+m, depth - 1)

    return summer

return chain_sum(val, calls_amount - 1)
#

But it should do arbitrary objects

#

but don't you call another function in it's arguments fixed, I think

broken mesa
wispy forge
#

!eval ```py
x, y = 0, 0
def foo():
x, y = 1, 1
class C:
print(x, y)
x = 2
foo()

night quarryBOT
#

@wispy forge :white_check_mark: Your eval job has completed with return code 0.

0 1
wispy forge
#

why in the f

#

!eval ```py
x, y = 0, 0
def foo():
x, y = 1, 1
class C:
print(x, y)
foo()

night quarryBOT
#

@wispy forge :white_check_mark: Your eval job has completed with return code 0.

1 1
wispy forge
#

Help me understand

proper vault
#

calculator supporting arbitrary expressions (no functions) in one line

compile(input("enter expression"),'','eval').co_consts[0]
``` (wonder if it can be broken somehow)
#

!e

print(compile('10*88+(88-8)','','eval').co_consts[0])
night quarryBOT
#

@proper vault :white_check_mark: Your eval job has completed with return code 0.

960
wispy forge
#

Interesting

soft prairie
#

!e


noreply@gmail.com```
night quarryBOT
#

@soft prairie :white_check_mark: Your eval job has completed with return code 0.

noreply@gmail.com
fluid tree
#

Fun

rugged sparrow
#

!e ```py
import sys

sentinel = object()

class Site:
def init(self, name, orig):
self.name = name
self.orig = orig
def getattr(self, _):
del globals()[self.name]
if self.orig is not sentinel:
globals()[self.name] = self.orig

class EmailMeta(type):
def getattr(cls, usr):
frame = sys.getframe(1)
f_code = frame.f_code
instr = frame.f_lasti + 2
site, ext, *
= map(
f_code.co_names.getitem,
f_code.co_code[instr+1::2]
)
orig = globals().get(site, sentinel)
globals()[site] = Site(site, orig)
return cls(usr, site, ext)

class email(metaclass=EmailMeta):
def init(self, usr, site, ext):
self.usr, self.site, self.ext = usr, site, ext

def __matmul__(self, _):
    return self

def __repr__(self):
    return f'{self.usr}@{self.site}.{self.ext}'

print(email.noreply@gmail.com)```

night quarryBOT
#

@rugged sparrow :white_check_mark: Your eval job has completed with return code 0.

noreply@gmail.com
sick hound
#

Yo LOL

#

That’s so sick

soft prairie
#

!e

endl = "\n"

x = 10

cout << "hi" << x << endl;```
night quarryBOT
#

@soft prairie :white_check_mark: Your eval job has completed with return code 0.

hi10
steep mural
#

!e

endl = '\n'
cout = 'cout'
_ = type('',(),{'__getitem__': lambda s, _: getattr(_.start, _.step)})()
std = type('',(),{'cout': type('',(),{'__lshift__': lambda s, i: (__import__('sys').stdout.write(i), s)[1]})()})
_[std::cout] << 'Hello world' << endl << 'lol' << endl;
night quarryBOT
#

@steep mural :white_check_mark: Your eval job has completed with return code 0.

001 | Hello world
002 | lol
sudden willow
#

woah wtf

#

thats cool

floral meteor
floral meteor
#

!e ```py
class Cursed(float):
class CursedCore:
def init(self):self.value=Cursed(0.0,cc=self);self.n=0
def call(self,n):self.n=n/2;return self
def get_value(self):=self.value;self.init();return Cursed(,cc=self)
def bool(self):self.value-=self.n;self.n=0;return False
def init(s,_a,**_k):super().init()
def new(c,a,b=0,cc=None):s=super().new(c,a);s.i=b;s.cc=cc;return s
mul=lambda s,n:Cursed(super().mul(n),s.i,s.cc)
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or super().add(n10**-s._numdec()),cc=s.cc)
add=lambda s,n:Cursed(super().sub(n),s.i,s.cc)
neg=lambda s:Cursed(0.0,s.i,s.cc)+s
and=lambda s,n:s-n
_getstr=lambda s:super(float,s).str()
_numdec=lambda s:0 if s.getstr().endswith('0')else len(s.split('.')[1])
str=lambda s:super(Cursed,s-s.cc.get_value()).str()
bool=lambda s:not s.cc(s)
def getattr(s, k):return Cursed(eval(s.get_str())+s.stuff[k]*0.1)
@classmethod
def bootstrap():
cc=
.CursedCore()
hundred=Cursed(100,1,cc);thousand=Cursed(1000,1,cc);million=Cursed(1000000,1,cc)
billion=million
thousand;trillion=billionthousand;quadrillion=billionmillion;septillion=quadrillionbillion
zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=(Cursed(,cc=cc)for _ in range(13));thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen=(Cursed(,cc=cc)for _ in range(13,20));twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=(ten
Cursed(_,cc=cc)for _ in range(2,10))
_.stuff = locals()
globals().update(locals())
Cursed._bootstrap()

print(five-hundred and forty-eight)

night quarryBOT
#

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

548.0
floral meteor
#

@broken mesa
python: you can't change what and does
me: watch me

broken mesa
#

LMAO but NICE!

floral meteor
#

now I'll get these decimals working without recursion errors

#

ah, _bootstrap doesn't effect globals when imported

#

okay now it's acting especially cursed:

from cursed import Cursed as _
globals().update(_._bootstrap())
five.eight
5.8
five.eight-eight
6.6
five.eight-eight-eight
7.3999999999999995
five.eight-eight-eight-eight
7.4
five.eight-eight-eight-eight-eight
8.200000000000001
five.eight-eight-eight-eight-eight-eight
8.20000000000001
five.eight-eight-eight-eight-eight-eight-eight
8.20000000000009
five.eight-eight-eight-eight-eight-eight-eight-eight
8.20000000000017
#

okay now it adds .8 each time

floral meteor
#

!e ```py
class Cursed(float):
class CursedCore:
def init(self):self.value=Cursed(0.0,cc=self);self.n=0
def call(self,n):self.n=n/2;return self
def get_value(self):=self.value;self.init();return Cursed(,cc=self)
def bool(self):self.value-=self.n;self.n=0;return False
def init(s,_a,**_k):super().init()
def new(c,a,b=0,cc=None):s=super().new(c,a);s.i=b;s.cc=cc;return s
mul=lambda s,n:Cursed(super().mul(n),s.i,s.cc)
sub=lambda s,n:Cursed((isinstance(n,Cursed)and n.i)and s
n or super().add(n0.1**s._numdec()),cc=s.cc)
add=lambda s,n:Cursed(super().sub(n),s.i,s.cc)
neg=lambda s:Cursed(0.0,s.i,s.cc)+s
and=lambda s,n:s-n
_getstr=lambda s:super(float,s).str()
_numdec=lambda s:0 if s._getstr().endswith('.0')else len(s._getstr().split('.')[1])+1
str=lambda s:super(Cursed,s-s.cc.get_value()).str()
bool=lambda s:not s.cc(s)
def getattr(s,k):return Cursed(eval(s.getstr())+s.stuff[k]*0.1,s.i,s.cc)
@classmethod
def bootstrap():
cc=
.CursedCore()
hundred=Cursed(100,1,cc);thousand=Cursed(1000,1,cc);million=Cursed(1000000,1,cc)
billion=million
thousand;trillion=billionthousand;quadrillion=billionmillion;septillion=quadrillionbillion
zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve=(Cursed(,cc=cc)for _ in range(13));thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen=(Cursed(,cc=cc)for _ in range(13,20));twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety=(ten
Cursed(_,cc=cc)for _ in range(2,10))
_.stuff = locals()
return locals()
globals().update(Cursed._bootstrap())
print(forty-seven.four-seven-two)

night quarryBOT
#

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

47.472
floral meteor
#

if i don't do the /2, the first one will return 800

broken mesa
#

sorry, im already helping in like 2 channels so im kinda busy and not in the mindset for esoteric right now

floral meteor
#

k i'll give them a look then

floral meteor
sick hound
#

i thought using "and" in numbers was incorrect

#

isn't it just "four hundred twenty"?

#

nvm im wrong

next flame
#

hmm, I always learned it as "'and' replaces the decimal point"

twilit grotto
#

like, 4 and a third?

floral meteor
#

I say numbers like "four hundred and twenty eight point seven six" for 428.76

steep mural
#

Now change it to "four hundred twenty eight and seventy six hundredths"

next flame
#

^ what i learned in school

#

though i usually just say "four hundred twenty eight point seven six"

twilit grotto
floral meteor
#
# float modulus go brrrr
__mod__ = lambda s,n:[{(s:=s-n)for __ in iter(lambda:s>n,False)},s][1]
#

the sign was wrong cos i pulled it from the Cursed class lol

#
class CursedFloat(float):
  __add__=lambda s,n:super(float,s).__sub__(n)
  __sub__=lambda s,n:super(float,s).__add__(n)
  __mod__=lambda s,n:[{(s:=s+n)for __ in iter(lambda:s>n,False)},s][1]
night quarryBOT
#

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

Starting...ERROR: name '_rat_mat' is not defined
floral meteor
#

!e ```py
def r(n):r=n.as_integer_ratio();={(r:=(int(r[0]/100000),int(r[1]/100000)))for _ in iter(lambda:r[0]>1000 and r[1]>1000,False)};a,b=r;return[[True]a,[False]b]
class Maybe(int):
r=import('random')
def new(s,n:float=1.0):s.c=n>0 and _r(n)or False;return s.r.choice(s.c)
bool=lambda s:s.r.choice(s.c);str=lambda s:s and"Maybe True"or"Maybe False";int=lambda s:s and 1 or 0
import os
def print_green(green=1):
now,strain=(time:=import('time').time)(),0.0001
try:green and os.system("")or{print(("".join([chr((Maybe(1.2)and 32)or(Maybe(0.8)and(48+Maybe()))or sum([Maybe()and 2j or 0 for j in range(7)]))for _i in range(200)]).translate(str.maketrans('','',''.join([chr(this) for this in range(25)])+chr(127))))[int(strain
100):int(100)-8],end=green
'\x1b[0m\x1b[33m'+'\r\n'+(strain:=-now+(now:=time())).str()[:6]+int(strain100)'|'+'\x1b[0m'green)for p in iter(lambda:print(end='\x1b[32m'green),True)}
except KeyboardInterrupt:print(green
'\x1b[0m'or'Interrupted')
except Exception as err: print(green
'\x1b[0m'or'ERROR:',err)
return True
print_green(0)

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 |      I  ,   0    #  1      1   %R     F110Q0   000 Y00 _  00  uI1 0 0 0iw  0  H00w1   ] )G J
002 | 0.0052  P  %0{ 0q   aq0  ]  1 A        |   10  0     1 *0Y 0H0 f _ G"]00^           0 1   0   y  L
003 | 0.00420  10/ x  0   8 1"   0   401 Ef     10B1+ 1 h  G+      ~ :8   0 1      `1  A-0  170  t 0   1
004 | 0.0040 0 00 80 1  1R 0 0q    :'   1 0     0       1 ^8   =    0 (              11  t1  01 1  z00n 
005 | 0.00410 011  0 0M   sU1 1  [0B'0          10  ^  m1 1  11 0   0* T 0 1 D0 1  S 1  0O  l       0 1g
006 | 0.004100  1;$    0R{    110       :0 B    11 k0 k  12      :  u07*         0  _ 0 j0  L e    =G ? 
007 | 0.004000]} 00 hb  e[  3c 1 1  A     1Y ]61000 1   4?10e    1  c>  0   o r 0  1  0O  0j  T  0      
008 | 0.0044 01 &   ]00 0 ~   1         I    k /  B0<"1~   1    1 01o 0  !1  0      0  9 00,   11(E0 @  
009 | 0.0036 :1   1   11       1  10      0V   1    1 01      1       ;1   01 8   10  hN     1 ,A 01    
010 | 0.0039  c 1 00  1  < 0    001   @0    s 0 0   0  0     
... (truncated - too long, too many lines)

Full output: too long to upload

sudden willow
#

The fuck

floral meteor
#

it's missing the bars

#

the bot can't output colour, and get_terminal_size is invalid

sick hound
#

!e

a = [1, 2, 3]
for i in a:
  print(i)
  if i == 2:
    s = []
night quarryBOT
#

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

001 | 1
002 | 2
003 | 3
sick hound
#

wack

#

wait

#

!e

a = [1, 2, 3]
for i in a:
  print(i)
  if i == 2:
    a = []
night quarryBOT
#

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

001 | 1
002 | 2
003 | 3
sick hound
#

???

#

!e

a = [1, 2, 3]
for i in a:
  print(i)
  if i == 2:
    print("here")
night quarryBOT
#

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

001 | 1
002 | 2
003 | here
004 | 3
sick hound
#

dafaq

#

!e

a = [1, 2, 3]
for i in a:
  print(i)
  if i == 2:
    a.pop()
night quarryBOT
#

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

001 | 1
002 | 2
sick hound
#

???

#

alright then

#
[i.append(input("y/n: ")) for i in [[input("y/n: "]] for j in i if j == "y"]```
#

!e

[i.append(input("y/n: ")) for i in [[input("y/n: "]] for j in i if j == "y"]```
night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     [i.append(input("y/n: ")) for i in [[input("y/n: "]] for j in i if j == "y"]
003 |                                                       ^
004 | SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
sick hound
#

!e

[i.append(input("y/n: ")) for i in [[input("y/n: ")]] for j in i if j == "y"]```
night quarryBOT
#

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

001 | y/n: Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
floral meteor
#

you can't input to bot

sick hound
#

yea

#

i just realized

#

l o l

floral meteor
#

give it dummy input

sick hound
#

how

#

also while loop in 1 line!

terse mortar
#

Also #bot-commands exists too lol

sick hound
#

shhh

#
while input("y/n: ") == "y":
  continue```
floral meteor
#

!e ```py
import random
class Input:
def init(self):pass
def call(self,s):print(s);return random.choice(['y','n'])
input=Input()
{i.append(input("y/n: ")) for i in [[input("y/n: ")]] for j in i if j == "y"}

night quarryBOT
#

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

y/n: 
floral meteor
#

hmm

sick hound
#

wack

#

you can do so much cool shit with just list comprehension

floral meteor
#

!e ```py
import random
class Input:
def init(self):pass
def call(self,s):print(s,end='');print((c:=random.choice(['y','n'])));return c
input=Input()
i='y'
{print((i:=input('y.n: '))) for _ in iter(lambda: i=='y',False)}

night quarryBOT
#

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

001 | y.n: y
002 | y
003 | y.n: y
004 | y
005 | y.n: n
006 | n
floral meteor
#

there

#

that's how you do it

sick hound
#

i'm too lazy to try to read that lmfao

#

walrus operators, i must learn synyax

stone lichen
#
(lambda _, __, ___, ____, _____, ______, _______, ________:
    getattr(
        __import__(True.__class__.__name__[_] + [].__class__.__name__[__]),
        ().__class__.__eq__.__class__.__name__[:__] +
        ().__iter__().__class__.__name__[_:][_____:________]
    )(
        _, (lambda _, __, ___: _(_, __, ___))(
            lambda _, __, ___:
                bytes([___ % __]) + _(_, __, ___ // __) if ___ else
                (lambda: _).__code__.co_lnotab,
            _ << ________,
            (((_____ << ____) + _) << ((___ << _____) - ___)) + (((((___ << __)
            - _) << ___) + _) << ((_____ << ____) + (_ << _))) + (((_______ <<
            __) - _) << (((((_ << ___) + _)) << ___) + (_ << _))) + (((_______
            << ___) + _) << ((_ << ______) + _)) + (((_______ << ____) - _) <<
            ((_______ << ___))) + (((_ << ____) - _) << ((((___ << __) + _) <<
            __) - _)) - (_______ << ((((___ << __) - _) << __) + _)) + (_______
            << (((((_ << ___) + _)) << __))) - ((((((_ << ___) + _)) << __) +
            _) << ((((___ << __) + _) << _))) + (((_______ << __) - _) <<
            (((((_ << ___) + _)) << _))) + (((___ << ___) + _) << ((_____ <<
            _))) + (_____ << ______) + (_ << ___)
        )
    )
)(
    *(lambda _, __, ___: _(_, __, ___))(
        (lambda _, __, ___:
            [__(___[(lambda: _).__code__.co_nlocals])] +
            _(_, __, ___[(lambda _: _).__code__.co_nlocals:]) if ___ else []
        ),
        lambda _: _.__code__.co_argcount,
        (
            lambda _: _,
            lambda _, __: _,
            lambda _, __, ___: _,
            lambda _, __, ___, ____: _,
            lambda _, __, ___, ____, _____: _,
            lambda _, __, ___, ____, _____, ______: _,
            lambda _, __, ___, ____, _____, ______, _______: _,
            lambda _, __, ___, ____, _____, ______, _______, ________: _
        )
    )
)
sick hound
#

ahh brainfuck in python

stone lichen
floral meteor
#
while (i:=input('y/n: ')) == 'y': print(i)
sick hound
#

what does that even do

stone lichen
#

if you run it, it outputs "hello world' iirc

sick hound
#

!e

(lambda _, __, ___, ____, _____, ______, _______, ________:
    getattr(
        __import__(True.__class__.__name__[_] + [].__class__.__name__[__]),
        ().__class__.__eq__.__class__.__name__[:__] +
        ().__iter__().__class__.__name__[_:][_____:________]
    )(
        _, (lambda _, __, ___: _(_, __, ___))(
            lambda _, __, ___:
                bytes([___ % __]) + _(_, __, ___ // __) if ___ else
                (lambda: _).__code__.co_lnotab,
            _ << ________,
            (((_____ << ____) + _) << ((___ << _____) - ___)) + (((((___ << __)
            - _) << ___) + _) << ((_____ << ____) + (_ << _))) + (((_______ <<
            __) - _) << (((((_ << ___) + _)) << ___) + (_ << _))) + (((_______
            << ___) + _) << ((_ << ______) + _)) + (((_______ << ____) - _) <<
            ((_______ << ___))) + (((_ << ____) - _) << ((((___ << __) + _) <<
            __) - _)) - (_______ << ((((___ << __) - _) << __) + _)) + (_______
            << (((((_ << ___) + _)) << __))) - ((((((_ << ___) + _)) << __) +
            _) << ((((___ << __) + _) << _))) + (((_______ << __) - _) <<
            (((((_ << ___) + _)) << _))) + (((___ << ___) + _) << ((_____ <<
            _))) + (_____ << ______) + (_ << ___)
        )
    )
)(
    *(lambda _, __, ___: _(_, __, ___))(
        (lambda _, __, ___:
            [__(___[(lambda: _).__code__.co_nlocals])] +
            _(_, __, ___[(lambda _: _).__code__.co_nlocals:]) if ___ else []
        ),
        lambda _: _.__code__.co_argcount,
        (
            lambda _: _,
            lambda _, __: _,
            lambda _, __, ___: _,
            lambda _, __, ___, ____: _,
            lambda _, __, ___, ____, _____: _,
            lambda _, __, ___, ____, _____, ______: _,
            lambda _, __, ___, ____, _____, ______, _______: _,
            lambda _, __, ___, ____, _____, ______, _______, ________: _
        )
    )
)```
night quarryBOT
#

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

Hello world!
sick hound
#

wack

stone lichen
#

one person got mad at me just for having an if and its body in the same line

sick hound
#

lmfaoo

stone lichen
#

like it was a single function call

#
if someshit: something()
#

:/

sick hound
#

meh that's fine

#

but if it was like if someshit: something(); someotherbullshit(); somehthingrandom(); i++; print(e)

#

lmfao

stone lichen
#

lmfao

sick hound
#

btw could you theoretically compile any program into a 1 liner?

#

if it wasn't oop based

elfin onyx
#

!e

def no_subclass(cls):
    def __init_subclass__(subcls):
        raise ValueError(f"{cls.__name__} Does not allow subclassing")
    cls = type(cls.__name__, tuple(cls.__subclasses__()), {**cls.__dict__, '__init_subclass__': __init_subclass__})
    return cls

@no_subclass
class A: ...

class B(A): ...

Done by @steep mural

night quarryBOT
#

@elfin onyx :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 |   File "<string>", line 3, in __init_subclass__
004 | ValueError: A Does not allow subclassing
stone lichen
#

ofc I would think there are limits

elfin onyx
#

lark, for parsing

sick hound
#

what limits

#

other than your computer just melting

#

but yae

stone lichen
#

no I was just thinking there could be limits on how well the delimiters would keep the program from knowing what's what without needing different lines

#

unless you did that

#

lmafo

sick hound
#

lmfao

#

i'm... just not gonna try to read that

stone lichen
#

no wait I was reading that

#

:(

sick hound
#

you can do like almost anything with list comprehensions and walruses

#

and lambdas

floral meteor
#

!e ```py
[(random:=import('random')),(input:=type("Input",(),{"init":lambda s:None,"call":lambda _,s:[print(s,end=''),print((c:=random.choice(['y','n']))),c][-1]})()),(i:='y'),{print((i:=input('y.n: '))) for _ in iter(lambda: i=='y',False)}]

night quarryBOT
#

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

001 | y.n: y
002 | y
003 | y.n: n
004 | n
floral meteor
#

there

#

one line. better, one expression

stone lichen
#

lmfao

#

love it

sick hound
#

love it

floral meteor
#

that's one list object

#

!e ```py
print(
[(random:=import('random')),(input:=type("Input",(),{"init":lambda s:None,"call":lambda _,s:[print(s,end=''),print((c:=random.choice(['y','n']))),c][-1]})()),(i:='y'),{print((i:=input('y.n: '))) for _ in iter(lambda: i=='y',False)}]
)

night quarryBOT
#

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

001 | y.n: n
002 | n
003 | [<module 'random' from '/usr/local/lib/python3.9/random.py'>, <__main__.Input object at 0x7f017f53dfd0>, 'y', {None}]
floral meteor
#

and it has all the important things in it

sick hound
#

seeing as there's only 1 random.choice

#

why not just replace that with random

floral meteor
#

k

#

!e ```py
print(
[[(input:=type("Input",(),{"init":lambda s:None,"call":lambda _,s:[print(s,end=''),print((c:=import('random').choice(['y','n']))),c][-1]})()),(i:='y'),{print((i:=input('y.n: '))) for _ in iter(lambda: i=='y',False)}] for j in range(42)]
)

sick hound
#

lmfao very nice

floral meteor
#

random choice my foot

sick hound
#

um

#

i think that might be a bit bugged

#

wait no

#

you did range 42

#

nvm

floral meteor
#

you see it always starts with 'n'

sick hound
#

is there a random.seed()

#

or smthing

night quarryBOT
#

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

001 | y.n: y
002 | y
003 | y.n: y
004 | y
005 | y.n: n
006 | n
007 | y.n: y
008 | y
009 | y.n: n
010 | n
011 | y.n: n
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/zorenozadi.txt

sick hound
#

there's a y

floral meteor
#

!e ```py
print(
[(random:=import('random')),(input:=type("Input",(),{"init":lambda s:None,"call":lambda _,s:[print(s,end=''),print((c:=random.choice(['y','n']))),c][-1]})()),(i:='y'),{print((i:=input('y.n: '))) for _ in iter(lambda: i=='y',False)}][0].random()
)

sick hound
#

!e

import random
a = {"y": 0, "z", 0}
for i in range(1000): a[random.choice(a)] += 1
print(a)```
night quarryBOT
#

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

001 |   File "<string>", line 2
002 |     a = {"y": 0, "z", 0}
003 |                     ^
004 | SyntaxError: invalid syntax
sick hound
#

um

#

oops

#

!e

import random
a = {"y": 0, "n": 0}
for i in range(1000): a[random.choice(a.keys())] += 1
print(a)```
night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 |   File "/usr/local/lib/python3.9/random.py", line 346, in choice
004 |     return seq[self._randbelow(len(seq))]
005 | KeyError: 1
sick hound
#

faq

night quarryBOT
#

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

001 | y.n: y
002 | y
003 | y.n: y
004 | y
005 | y.n: y
006 | y
007 | y.n: y
008 | y
009 | y.n: n
010 | n
011 | 0.009768337441831698
floral meteor
#

there

sick hound
#

!e

import random
a = {"y": 0, "n": 0}
for i in range(1000): a[random.choice(a.keys())] += 1
print(a)```
night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 |   File "/usr/local/lib/python3.9/random.py", line 346, in choice
004 |     return seq[self._randbelow(len(seq))]
005 | TypeError: 'dict_keys' object is not subscriptable
sick hound
#

.

#

ffs

floral meteor
#

gtg bye
have fun, or else...

sick hound
#

ummm

#

i sense a threat

floral meteor
#

I WILL FIND YOU IF YOU DON"T HAVE FUN AHHAHAHAHA
jk

sick hound
#

oh god oh fuck

floral meteor
#

parting challenge (you cant do this with bot):
yellow bars and floats are the time it takes to print the previous line.
one yellow bar for every 0.01 seconds printing random green text or spaces or 0s or 1s.
gotta be coloured. os.system("") and \x1b[32m should start you off \x1b[0m

#

gl

floral meteor
#

Challenge: calculate how long this is likely to take to damage your computer

earnest wing
#

odds are, considering you'll almost exclusively have mangled headers

floral meteor
#

almost

#

What are those odds?

earnest wing
slim cairn
#

!e

night quarryBOT
#
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.

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

slim cairn
#

!e

# Program make a simple calculator

# This function adds two numbers
def add(x, y):
    return x + y

# This function subtracts two numbers
def subtract(x, y):
    return x - y

# This function multiplies two numbers
def multiply(x, y):
    return x * y

# This function divides two numbers
def divide(x, y):
    return x / y


print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")

while True:
    # Take input from the user
    choice = input("Enter choice(1/2/3/4): ")

    # Check if choice is one of the four options
    if choice in ('1', '2', '3', '4'):
        num1 = float(input("Enter first number: "))
        num2 = float(input("Enter second number: "))

        if choice == '1':
            print(num1, "+", num2, "=", add(num1, num2))

        elif choice == '2':
            print(num1, "-", num2, "=", subtract(num1, num2))

        elif choice == '3':
            print(num1, "*", num2, "=", multiply(num1, num2))

        elif choice == '4':
            print(num1, "/", num2, "=", divide(num1, num2))
        break
    else:
        print("Invalid Input")
night quarryBOT
#

@slim cairn :x: Your eval job has completed with return code 1.

001 | Select operation.
002 | 1.Add
003 | 2.Subtract
004 | 3.Multiply
005 | 4.Divide
006 | Enter choice(1/2/3/4): Traceback (most recent call last):
007 |   File "<string>", line 28, in <module>
008 | EOFError: EOF when reading a line
last locust
#

Wrong channel (#bot-commands) and the bot doesn't support input @slim cairn

slim cairn
#

Ohk

dreamy gorge
#

hi

#

i have some errors in Python code

naive roost
#

hi

dreamy gorge
#

please

#

Type your code here

def find_gcd(l):
num1=l[0]
num2=l[1]
for i in range(2,len(l)):
a=num1

    b=num2   
    lista=[]
    for i in range(3,11):
        if (a%i==0) and (b%i==0):
            lista.append(i)

    acumulado=lista
    if acumulado==[]:

        return 1
    else:

a=acumulado[-1]

        return (acumulado[-1])
#

the error:

#

Your function return is NOT CORRECT.
For example when your function is called as shown below:
find_gcd([40, 80, 50])
Your function returns:
4
The correct return value is:
10

naive roost
dreamy gorge
#

the topic Write a function named find_gcd that accepts a list of positive integers and returns their greatest common divisor (GCD). Your function should return 1 as the GCD if there are no common factors between the integers.

#

thaks

sudden willow
#

!e

# i just learned how to use walrus operator
print(_:=True.__int__())
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

1
sudden willow
#

i like this

#

im sure im not using it to its full extent but pretty cool

naive roost
#

!e ```py
print(:=True.int())
print(
+1)

night quarryBOT
#

@naive roost :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
sudden willow
#

!e

print(_:=True.__int__())
print(_.__add__(_:=True.__int__()))
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
naive roost
#

yep, you get it. Now you can play with that in #bot-commands if you want to πŸ™‚

sick hound
#

wait shit

#

!e

#

easiest quine

night quarryBOT
#

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

[No output]
sudden willow
#

memoryerror condensed into one line!

#

!e
print(_:=["_"], _:=[_.append(__*2)for __ in _])

night quarryBOT
#

@sudden willow :warning: Your eval job timed out or ran out of memory.

[No output]
restive bronze
#

How do I fix unused variable guild

sudden willow
#

remove the variable guild

restive bronze
#

Remove the word guild

naive roost
#

if you're modifying the collection you're looping over, you deserve the bad things that might happen to you

restive bronze
#

???????

sudden willow
#

i was actually trying to figure out how to append it to the list and then pop it to create an infinite loop, but im lazy

naive roost
restive bronze
#

This is dumb

naive roost
#

if you're not doing talking about esoteric Python, you might not want to talk here

#

if you want help, ask for help in the relevant help channels

restive bronze
#

What estro

#

Esoteric

naive roost
#

like the subject says: Golfing, Python VM languages, obfuscation, code gore and other general Python weirdness

sick hound
sudden willow
#

!e

print(_:=["_"], _:=[(_.append(__*2).pop(0))for __ in _])
sick hound
#

.pop(0)

naive roost
#

append returns None

sick hound
#

while loop in list comprehension

#

kekw

sudden willow
#

!e
print(_:=["_"], _:=[(_.append(__*2), _.pop())for __ in _])

night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

['_'] [(None, '__')]
sudden willow
#

huh

#

o wait

fluid tree
#

I used it to mean ,

#

int(twenty-seven-thousand. two-hundred and fifty-three) == 27253

sick hound
#

!e

import string
_______ = [x for x in range(0,10)]
____,_____,______ = _______[1],_______[2],_______[3]
___________________,____________________________ = list(),[]
[____________________________.append(x) for x in eval('elbatnirp.gnirts'[::-1])]
[___________________.append(eval('elbatnirp.gnirts'[::-1])) for ______________ in ____________________________]
__=print
exec('def print(_):\n\tif(0.1+0.2 == 0.30000000000000004):\n\t\treturn(_)')
___ = [___________________[46][43],___________________[54][14], ___________________[29][34]]
_={194*0+5-4:___[0],5-______+_____-2:___[____],______-4+4*2/_____:___[2]}
def ________():
    return _[____]+_[_____]+_[______+____-____]
__(________())
night quarryBOT
#

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

Hey
sick hound
#

coolio

frozen holly
#

I think my favorite thing for version checking is

if 3 / 2 == 1:
    input = raw_input
naive roost
#

you might have wanted to say 3/2 == 1

frozen holly
#

Oopsie

#

Look It's late I'm tired

naive roost
#

so am I πŸ˜…

sick hound
#

ooh

naive roost
#

but yeah, it's interesting. probably more efficient than import sys; sys.version >= 3.0 or something

floral meteor
#

Not really, that involves importing the sys module

sudden willow
#

!e
print(_:=True.__int__().__add__(_:=True.__int__()))

night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

2
sudden willow
#

ah yes more letters to feed into my equation-inator

#

!e

print(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__().__add__(_:=True.__int__()))))))))))
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

10
plucky wedge
#

!e
x = 1
print(x.add)

night quarryBOT
#

@plucky wedge :white_check_mark: Your eval job has completed with return code 0.

<method-wrapper '__add__' of int object at 0x7fa5cb657930>
plucky wedge
#

:/

#

First time

sudden willow
#

x = 1 print(x.__add__(int))

plucky wedge
#

oh

tribal moon
#

maybe instead of True.__int__() try __debug__.__bool__().__int__()

#

adds more dunders

sudden willow
#

hmm okay

#

heres the program i used to generate it btw

import sys

with open("writeoff.txt", "w") as f:
  temp=int(sys.argv[1])-2
  f.write("print(_:=__debug__.__bool__().__int__().__add__(")

  for i in range(temp):
    f.write("_:=__debug__.__bool__().__int__().__add__(")
  f.write("_:=__debug__.__bool__().__int__()" + ")" * int(temp+2))
tribal moon
#

maybe instead of print you can do py ((lambda __, ___, ____, _____: getattr(__builtins__,().__class__.__name__[__ << __]+ ().__iter__().__class__.__name__[(__).__rmul__(-1)]+ [].__class__.__name__[____ % ___]+ chr(_____)+ ().__class__.__name__[__ >> __],))((lambda _: _).__code__.co_nlocals,(lambda _, __: _ | __).__code__.co_nlocals,(lambda _, __, ___: _ | __ | ___).__code__.co_nlocals,((lambda _, __, ___: _ & __ & ___).__code__.co_nlocals.__rmul__((lambda _, __, ___: _ | __ | ___).__code__.co_nlocals)+ (True.__rmul__((lambda _, __: _ | __).__code__.co_nlocals))).__rmul__((lambda _, __, ___, ____, _____, ______, _______, ________, _________, __________:_).__code__.co_nlocals),))

sick hound
#

y

tribal moon
#

lol

sudden willow
#

wtf

timid kraken
#

What is this stuff you guys are always typing

sudden willow
#

simple python programs of course

sick hound
#

very simple

timid kraken
#

Doesn't look simple

sudden willow
#

!e

print(__debug__)
night quarryBOT
#

@sudden willow :white_check_mark: Your eval job has completed with return code 0.

True
sick hound
#

kek

sudden willow
#

thats cool

sick hound
#

why is _debug_ true?

sudden willow
#

not sure

#

but i guess you can convert __debug__ to True as a bool and then convert it to an int and return 1

tribal moon
#

debug is True because it runs the program unoptimized I think

sudden willow
#

hmm

sick hound
#

ah so you're just abusing stuff

sudden willow
#

!e

try: a
except: print(__debug__)