#esoteric-python

1 messages ยท Page 4 of 1

unreal echo
#

this is @zealous widget terminal level stuff

zealous widget
#

haven't done solar system yet

floral meteor
#

exactly 8 hours

floral meteor
#

Including stopping for a moment to watch netflix because adhd

floral meteor
#

Would you like to user test it? wasd turn to move one space, arrow keys turn to move one panel. Esc to quit

#

There might be one bug, find it and I'll show you how to make pretty loadbars.

serene stratus
#

Oddly specific reward

sick hound
unreal echo
#

i mean like not in the code

#

the game

restive void
floral meteor
unreal echo
floral meteor
#

The other option was set t to now+.5 instead of previous time +.5, but the lag is still there

#

Esc cuts the lag, so it's not real lag

#

I think I might have an idea of the cause, but I can't fix it now.

#

Well technically I can, but there's a high risk of accidentally deleting it, I have a discord bot running on my laptop and I'm on phone.

maiden blaze
#

big funny

floral meteor
#

Noice

languid hare
silk ether
#

1 liner to play tic-tac-toe with the boys
(there is nothing that prevent char overriding so be careful when you play bcs it ends after 9 plays and there is no win detection but im sure you know the rules)

(i:=0,p:=True,g:=["โ–ก"]*9,[(g.__setitem__(int(input())-1,"X"if(p:=not p)else"O"),[print(c,end=""if(i:=i+1)%3else"\n")for c in g])for h in g])
maiden blaze
languid hare
#

figured

buoyant vigil
#

im not sure where to ask this: lets say i use "pip install -e" to install the package im developing for in my user folder. i install this to a python virtualenv that all users on the machine can access. will other users be able to use this package properly? will they need permissions to access files in my user folder for it to work?

floral meteor
#

Yes, unless you install it in program files

versed eagle
versed eagle
#

oh do you use windows?

#

that explains it lol

floral meteor
#

ewww linux

fleet bridge
royal whale
maiden blaze
#
from fishhook import hook
import inspect
def __getattr__(self, s):
    f = inspect.currentframe().f_back.f_locals[s]
    return lambda *args, **kwargs: self(f(*args, **kwargs))
hook(type(lambda: 0))(__getattr__)
hook(type(print))(__getattr__)


def double(x):
    return 2 * x

def square(x):
    return x**2

print . double . square (5)

fleet bridge
#

cool
chaining functions using @ is more pythonic, i think (and it doesnt require that hacks)
print @ double @ square (5)

floral meteor
#

you could __import__('sys')._getframe(1).f_locals[s]

fleet bridge
#
@hook(type(lambda: 0))
@hook(type(print))
def __getattr__(self, s):
    ...

# instead of:
def __getattr__(self, s):
    ...
hook(type(lambda: 0))(__getattr__)
hook(type(print))(__getattr__)
floral meteor
#

onelinerised ```py
from fishhook import*;import sys;g='getattr';hook(type(print),g)(hook(type(lambda:0),g)(lambda s,k:lambdaa,**k:s(sys._getframe(1).f_localsk)));double=lambda x:2x;square=lambda x:x**2;print.double.square(5)

serene stratus
floral meteor
#

nah, it's a dictionary

maiden blaze
serene stratus
serene stratus
#

Does adding this break anything else

#

Or does it only add stuff

fleet bridge
earnest wing
#

that being said, get ready for my custom operators library

#

you can use >>= in expression position

#

and <$>

#

and all the fun stuff

#

like (+) and `foo`

maiden blaze
#

surely the parser cant allow that

earnest wing
#

give it a little help

#

with codecs

fleet bridge
#

how to add support for your operators into some tools (black and mypy, for example)?

earnest wing
#

by screaming, typically

maiden blaze
finite blaze
#

And what will these operators do?

earnest wing
#
  • codecs.register(customcodec) before your module is parsed
  • # coding: yourcustomcodec
maiden blaze
#

interesting

maiden blaze
earnest wing
#

(part 1 may require sitecustomize/.pth dumbness if you don't want to explicitly import your module from a "runner")

floral meteor
sly root
#

!e ```py
class Function:
overloads = {}

def overload(self, argument_types, keyword_types=[]):
return lambda function: self.overloads.update({tuple([tuple(argument_types), tuple(keyword_types)]): function})

def call(self, *args, **kwargs):
for overload in list(self.overloads.items()):
if [*map(type, args)] == [*overload[0][0]]:
if len(sum(kwargs.items(), ())) > 0:
if [*map(type,[*kwargs.values()])] == [*overload[0][1]]:
return overload[-1](*args, **kwargs)
return overload-1

a = Function()

@a.overload([int, int])
def test(_a: int, _b: int) -> int:
return _a + _b

@a.overload([int, str])
def test(_a: int, _b: str) -> int:
return str(_a) + _b

print(a(3, 3))
print(a(3, "hello"))```

night quarryBOT
#

@sly root :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 6
002 | 3hello
restive void
floral meteor
#

what's the newline character posting ratelimit in this server?

sly root
# restive void if you're anyways using type hints, may as well use those instead of explicitly ...

!e ```py
class Function:
overloads = {}

def overload(self):
return lambda function: self.overloads.update({tuple([*function.annotations.values()])[:-1]: function})

def call(self, *args, **kwargs):
for overload in list(self.overloads.items()):
if [*map(type, args), *map(type, [*kwargs.values()])] == [*overload[0]]:
return overload[-1](*args, **kwargs)
else: continue
return None

a = Function()

@a.overload()
def test(_a: int, _b: int) -> int:
return _a + _b

@a.overload()
def test(_a: int, _b: str) -> int:
return str(_a) + _b

print(a(3, "hello"))
print(a(238, 391))```

night quarryBOT
#

@sly root :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 3hello
002 | 629
last locust
#

That's what my bot config has anyway, which I assume is the same as for @night quarry

night quarryBOT
#

config-default.yml lines 441 to 444

newlines:
    interval: 10
    max: 100
    max_consecutive: 10```
manic grove
#

Whatโ€™s code gore?

floral meteor
restive void
# sly root !e ```py class Function: overloads = {} def overload(self): return lamb...

!e alternative using inspect

import inspect

nope = object()
overloads = {}

def overload(fn):
    def wrapper(*args, **kwargs):
        for sig, func in overloads.get(fn.__qualname__, []):
            bound = sig.bind(*args, **kwargs)
            for name, value in bound.arguments.items():
                if not isinstance(value, func.__annotations__[name]):
                    break
            else:
                return func(*args, **kwargs)
        raise TypeError("beep boop")
    overloads.setdefault(fn.__qualname__, []).append((inspect.signature(fn), fn))
    return wrapper


@overload
def add(x: int, y: int): return x + y

@overload
def add(x: str, y: int): return f"{x} says {y}"

print(add(23, 53))
print(add("foo", 53))
night quarryBOT
#

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

001 | 76
002 | foo says 53
floral meteor
manic grove
sly root
#
fn=type("fn",(),{"_x":{},"_o":lambda _0:lambda _1:_0._x.update({tuple([*_1.__annotations__.values()])[:-1]:_1}),"__call__":lambda _0,*_1,**_2:[_3[-1](*_1,**_2)for _3 in[*_0._x.items()]if[*map(type,_1),*map(type,[*_2.values()])]==[*_3[0]]][0]})

minified

#

I think using __dict__ will be better instead of defining a class property

#
class Function:
  def overload(self):
    return lambda function: self.__dict__.update({tuple([*function.__annotations__.values()])[:-1]: function})
  
  def __call__(self, *args, **kwargs):
    for overload in [*self.__dict__.items()]:
      if [*map(type, args), *map(type, [*kwargs.values()])] == [*overload[0]]:
        return overload[-1](*args, **kwargs)
      else: continue
    return None ```
floral meteor
floral meteor
# unreal echo nice

I just tested it for 2D usage score=__name__=='__main__'==Interface(10,10,1,1).run().score and 3D usage score=__name__=='__main__'==Interface(10,10,10,1).run().score.
It works great, so the 2D only script is now redundant

#

meaning 3D snake is also done

restive void
# sly root ```py class Function: def overload(self): return lambda function: self.__d...

I'm just putting it in a MuTaBlE DeFaUlT ArGuMeNt now:

def overload(fn, overloads={}, nope=object()):
    def wrapper(*args, **kwargs):
        for sig, func in overloads.get(fn.__qualname__, []):
            bound = sig.bind(*args, **kwargs)
            for name, value in bound.arguments.items():
                if not isinstance(value, func.__annotations__[name]):
                    break
            else:
                return func(*args, **kwargs)
        raise TypeError("beep boop")
    overloads.setdefault(fn.__qualname__, []).append((inspect.signature(fn), fn))
    return wrapper
floral meteor
#

oh no!

#

anyway...

#

2D snake, 3D snake and 4D snake in one week, and not necessarily in that order

restive void
floral meteor
#

ancient artifact

floral meteor
# unreal echo i did find it

as promised ```py
import('os').system('')
def loadbar(size):
def map(f,*a):
nonlocal size;[]=result=()
try:assert(l:=len(a:=[*zip(a)]))
except:return f()
print(f"\x1b[42m[\x1b[m{' 'abs(size)}\x1b[44m]\x1b[m {l} iterations remaining. ",end='\x1b[G',flush=1)
for i,e in enumerate(a):
result+=f(e),;n=iabs(size)//l
r=12;g=255-(b:=i
255//l);o=g
b//255;g+=o;b+=o # change formulae for r,g,b as needed
print(f"\x1b[42m[\x1b[{n+1 if size>0 else-size-(n-1)}G\x1b[48;2;{r};{g};{b}m \x1b[44m\x1b[{abs(size)+1}G]\x1b[m {l-i} iterations remaining. ",end='\x1b[G',flush=1)
print(f'\x1b[42m[\x1b[{abs(size)+1}G\x1b[44m]\x1b[m 0 iterations remaining. ');return result
return map

import time
loadbar(-40)(time.sleep,[.1]*60)

restive void
#

(yeah, I could rename fn to something else..)

floral meteor
#

name it to n

#

oh wait

#

q

#

do q

restive void
#

also, beep is unnecessarily long

floral meteor
#

b

#

or _

restive void
#
overload=lambda c,o={}:o.setdefault(q:=c.__qualname__,[]).append((__import__("inspect").signature(c),c))or(lambda*a,**k:any(all(isinstance(v,(F:=f).__annotations__[n])for n,v in s.bind(*a,**k).arguments.items())for s,f in o.get(q,[]))and F(*a,**k)or X)

other than changing the public API, I see no obvious spots for saving bytes

sly root
restive void
quartz wave
quartz wave
versed eagle
quartz wave
versed eagle
#

your terminal language sucks though

quartz wave
versed eagle
#

cmd

#

I haven't looked at powershell yet, so idk if it's good or not

quartz wave
versed eagle
#

I'm on mobile, so i can't type fast
you're gonna have to wait a bit lol

quartz wave
#

ok tbh i don't even care anymore i just wanna have all of the stuff i want conveniently included in one thing without needing anything else

rocky leaf
rocky leaf
#

New challenge, a calendar that prints every day of the year for a whole year; starting from Monday, jan 1st 1999

#

No rules except thatโ€ฆ.. GO!!!

royal whale
#

Idk if you'd consider it a terminal language, but the point still stands...

floral meteor
#

Batch and cmd are almost the same thing

rocky leaf
#

I donโ€™t understand the difference between any terminals

#

Powershell makes no sense

floral meteor
#

PowerShell has a few os interactions cmd can't do, otherwise I rarely use it.

rocky leaf
#

I tend to use it for running scripts that need to be on for a couple weeks

#

Because blue = donโ€™t close this window

floral meteor
#

color followed by two hexadecimal characters

#

Figure out which one is blue and you have blue terminal

#

Alternatively, typing ctrl-[, [44m will begin text with a blue background, then you can fill the terminal with spaces or whatever

floral meteor
#

You now have no use for pwershell

floral meteor
#

You probably want 1f though not 17

drowsy cobalt
silk ether
#

(it doesn't work)

floral meteor
#

That's why you don't use gui, graphics are lame when you already have a terminal

#

What do you make of this, should I keep these fractional loadbars like such?

#

or negative loadbar size?

#

or negative loadbar size goes backwards?

rocky leaf
#

Donโ€™t care what anyone says Iโ€™ve learned more with copilot then without it

#

Itโ€™s one of the best tools Iโ€™ve ever seen, and it suited my beginner level when it came out so I ended up learning so much from it.

It a funny way, it doesnโ€™t show you how to write the best code. Somehow it telegraphs that to you if your not a complete beginner

#

So you end up writing better code, and therefore learning how to write better code

#

Making a habit of constant improvement

#

I seen so many videos saying itโ€™s a waste of time or it will make you lazy, but if Iโ€™m being paid to write hundreds of lines of code by myself, a little bit of help (sometimes a lot) goes a long way

#

I think the future is going to be all AI assisted programming and, It will only raise the bar for skill level

floral meteor
#

the style of code I write cannot be produced with ai, I would probably break the ai, or corrupt it and cause the robot revolution.

proper vault
#

the second you start writing code which hasn't been done before, copilot gets really useless. Though doing that is quite rare most of the time.

earnest wing
#

Copilot is useful

restive flare
#

dang! this channel is awesome

unreal echo
#

You cannot leave this channel mortal

#

You had not heeded the warning

#

You are doomed to be driven insane in this God forsaken realm

#

With no exit in sight

#

If you manage to leave, you will bring dangers of which you cannot fathom to the land of mortals.

#

Armageddon will rear its head while all those under it cower.

sage idol
#

Hi uh, just for reference whats code gore? Listed on this chat description

restive void
#

Hurts to look at, you'll want to wash your eyes afterwards. Like regular gore, but with code.

maiden blaze
sage idol
#

Thanks both of you ๐Ÿ‘๐Ÿ‘๐Ÿ‘ @restive void @maiden blaze

maiden blaze
#

(my message was a joke btw)

sage idol
#

oof, well i didnt get it lmfao

bronze agate
earnest wing
#

you should've at least linked to the nomicon lol

#

way more appropriate here

versed eagle
#

sorry!

versed eagle
royal whale
simple sphinx
#

Rust is still too new to have truly esoteric code, but in a few years maybe when it's 10 it will be a worthy competitor

simple sphinx
ripe talon
#

You can't compare Rust with python!

sullen kayak
#
import string; print('\n'.join(map(str,[f"{char} has index {num}" for num, char in [*map(list,[*zip([i+1 for i in range(26)], [i for i in "".join(sorted(set(__import__("re").findall("\\w","".join("".join(__import__(m).__dict__).lower() for m in("collections", "builtins"))))-{"_"}))])])]])))
#

any way to make this more complicated and hard to read?

quartz wave
sullen kayak
#

dunder method?

restive void
quartz wave
#

@sullen kayak

#

the hellhole of underscore soup

sullen kayak
#

what the HELL is taht

quartz wave
sullen kayak
#

like that????

#

!e

import string; print('\n'.join(map(str,[f"{char} has index {num}" for num, char in [*map(list,[*zip([i+1 for i in range(26)], [i for i in "".join(sorted(set(__import__("re").findall("\\w","".join("".join(__import__(m).__dict__).lower() for m in("collections", "builtins"))))-{"_"}))])])]])))
night quarryBOT
#

@sullen kayak :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | a has index 1
002 | b has index 2
003 | c has index 3
004 | d has index 4
005 | e has index 5
006 | f has index 6
007 | g has index 7
008 | h has index 8
009 | i has index 9
010 | j has index 10
011 | k has index 11
... (truncated - too many lines)

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

sullen kayak
#

oh my god

#

the first part defo has some way to be made impossible to read tho, eh?

restive void
#

!e can make the second part a bit more obscure

print('\n'.join(map(str,[f"{char} has index {num}" for num, char in [*map(list,[*zip([i+1 for i in range(26)], [i for i in "".join(map(chr,sorted(filter((95).__lt__,map(ord, set(__import__("re").findall("\\w","".join(dict.__or__(*(__import__(m).__dict__ for m in(str({}.__class__.__module__),"collections")))))))))))])])]])))
night quarryBOT
#

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

001 | a has index 1
002 | b has index 2
003 | c has index 3
004 | d has index 4
005 | e has index 5
006 | f has index 6
007 | g has index 7
008 | h has index 8
009 | i has index 9
010 | j has index 10
011 | k has index 11
... (truncated - too many lines)

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

earnest wing
restive void
#

Yeah, or just define __eq__ and __lt__ on type(Python) and type(Rust) and then use the functools.total_ordering decorator.

marsh raptor
#

Does this count as code gore? It's a 7572 lines long list.

unreal echo
sullen kayak
# unreal echo what are you trying to do

!e

print('\n'.join(map(str,[f"{char} has index {num}" for num, char in [*map(list,[*zip([i+1 for i in range(26)], [i for i in "".join(sorted(set(__import__("re").findall("\\w","".join("".join(__import__(m).__dict__).lower() for m in("collections", "builtins"))))-{"_"}))])])]])))
night quarryBOT
#

@sullen kayak :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | a has index 1
002 | b has index 2
003 | c has index 3
004 | d has index 4
005 | e has index 5
006 | f has index 6
007 | g has index 7
008 | h has index 8
009 | i has index 9
010 | j has index 10
011 | k has index 11
... (truncated - too many lines)

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

sullen kayak
#

i think this describes the pattern well enough.

last locust
#

That does make it visually longer though, if you're wanting it short

sullen kayak
#

oh nonono

#

i do not want it short

#

i just want it to be hard to read

#

ynno

#

for fun ^w^

last locust
#

Also not sure what the point of the import string is given that you don't seem to be using it anywhere

last locust
last locust
#

But you're not using the import

sullen kayak
#
import string; print('\n'.join(map(str,[f"{char} has index {num}" for num, char in [*map(list,[*zip([i+1 for i in range(26)], [i for i in string.ascii_lowercase])])]])))
last locust
#

Right, there you are

sullen kayak
#

!e

print('\n'.join(map(str,[f"{b} \x20\x68\x61\x73\x20\x69\x6E\x64\x65\x78\x20 {a}"for a,c in[*map(list,[*zip([i+1for i in range(26)],[i for i in "".join(sorted(set(__import__("re").findall("\\w","".join("".join(__import__(m).__dict__).lower()for m in("collections", "builtins"))))-{"_"}))])])]])))
night quarryBOT
#

@sullen kayak :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | a has index 1
002 | b has index 2
003 | c has index 3
004 | d has index 4
005 | e has index 5
006 | f has index 6
007 | g has index 7
008 | h has index 8
009 | i has index 9
010 | j has index 10
011 | k has index 11
... (truncated - too many lines)

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

sullen kayak
#

i wonder how that works

last locust
#

You can also remove some spaces that aren't needed

#

e.g. " for -> "for
i+1 for -> i+1for
(there's others too just cba to list all of them)

last locust
sullen kayak
#

!e print("\x20\x68\x61\x73\x20\x69\x6E\x64\x65\x78\x20")

night quarryBOT
#

@sullen kayak :white_check_mark: Your 3.11 eval job has completed with return code 0.

 has index 
sullen kayak
#

easy.

#

!e

print('\n'.join(map(str,[f"{c} \x20\x68\x61\x73\x20\x69\x6E\x64\x65\x78\x20 {a}"for a,c in[*map(list,[*zip([i+1for i in range(26)],[i for i in "".join(sorted(set(__import__("re").findall("\\w","".join("".join(__import__(m).__dict__).lower()for m in("collections", "builtins"))))-{"_"}))])])]])))
#

smhh

night quarryBOT
#

@sullen kayak :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | <string>:1: SyntaxWarning: invalid decimal literal
002 | a  has index  1
003 | b  has index  2
004 | c  has index  3
005 | d  has index  4
006 | e  has index  5
007 | f  has index  6
008 | g  has index  7
009 | h  has index  8
010 | i  has index  9
011 | j  has index  10
... (truncated - too many lines)

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

sullen kayak
#

amazing.

last locust
#

You can do it for all of those strings

#

Even the {c} and {a} iirc

#

And then the imports etc.

#

There's also a space I think after the in in i for i in "".join(...) that isn't needed (for i in"".join(...))

last locust
twin reef
#

!e

import re

source = R"""print('\n'.join(map(str,[f"{c} \x20\x68\x61\x73\x20\x69\x6E\x64\x65\x78\x20 {a}"for a,c in[*map(list,[*zip([i+1for i in range(26)],[i for i in "".join(sorted(set(__import__("re").findall("\\w","".join("".join(__import__(m).__dict__).lower()for m in("collections", "builtins"))))-{"_"}))])])]])))"""

ESCAPE = "R_"
SORTED = f"{ESCAPE}S__"
BUILTINS = f"{ESCAPE}B__"
KEYS = f"{ESCAPE}K__"

SORTED_STR = "".join(map(lambda x: "\\" + hex(x)[1:], list(bytes("sorted", "utf-8"))))


for i, b in enumerate(sorted(__builtins__.__dict__.keys())):
    x = f"(lambda {ESCAPE}_:{BUILTINS}[{SORTED}([{ESCAPE}__ for {ESCAPE}__ in {KEYS}])[{ESCAPE}_]])({hex(i)})"
    source = re.sub(rf"((?<![\w\.\']){b}(?!\w))", x, source)

source = f"(lambda {BUILTINS}: (lambda {SORTED},{KEYS}:{source})({BUILTINS}['{SORTED_STR}'],{BUILTINS}.keys()))(__builtins__.__dict__)"

print(source)
night quarryBOT
#

@twin reef :white_check_mark: Your 3.11 eval job has completed with return code 0.

(lambda R_B__: (lambda R_S__,R_K__:(lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x85)('\n'.join((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x7b)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x90),[f"{c} \x20\x68\x61\x73\x20\x69\x6E\x64\x65\x78\x20 {a}"for a,c in[*(lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x7b)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x79),[*(lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x96)([i+1for i in (lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x87)(26)],[i for i in "".join((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x8e)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x8b)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x4d)("re").findall("\\w","".join("".join((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x4d)(m).__dict__).lower()for m in("collections", "builtins"))))-{"_"}))])])]]))))(R_B__['\x73\x6f\x72\x74\x65\x64'],R_B__.k
... (truncated - too long)

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

twin reef
#

!e

(lambda R_B__: (lambda R_S__,R_K__:(lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x85)('\n'.join((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x7b)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x90),[f"{c} \x20\x68\x61\x73\x20\x69\x6E\x64\x65\x78\x20 {a}"for a,c in[*(lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x7b)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x79),[*(lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x96)([i+1for i in (lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x87)(26)],[i for i in "".join((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x8e)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x8b)((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x4d)("re").findall("\\w","".join("".join((lambda R__:R_B__[R_S__([R___ for R___ in R_K__])[R__]])(0x4d)(m).__dict__).lower()for m in("collections", "builtins"))))-{"_"}))])])]]))))(R_B__['\x73\x6f\x72\x74\x65\x64'],R_B__.keys()))(__builtins__.__dict__)
night quarryBOT
#

@twin reef :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | <string>:1: SyntaxWarning: invalid decimal literal
002 | a  has index  1
003 | b  has index  2
004 | c  has index  3
005 | d  has index  4
006 | e  has index  5
007 | f  has index  6
008 | g  has index  7
009 | h  has index  8
010 | i  has index  9
011 | j  has index  10
... (truncated - too many lines)

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

twin reef
#

wow it worked

sullen kayak
#

i'm bored i'm goina make my randomised variant of python

twin reef
# sullen kayak WHAT????

it's an obfuscator i made some time ago, it simply replaces built-in functions with (approximately) __builtins__.__dict__[__builtins__.__dict__.keys()[{index of builtin}]]

#

simple yet effective

twin reef
unreal echo
#

i'll try it

unreal echo
#

yeah here's a better way to do this

#
load_bar=lambda s:(lambda g,b,l,k:[(l:=l+f'\033[38;2;0;{g};{b};1mโ–ˆ\033[0m',b:=b-k,g:=g+k,__import__('time').sleep(.1),print('\033[1A',end=''),print(l))for i in range(256//s)][-1][0])(0,256,'',s%256)
load_bar(2)```
#

not exactly as estoeric, but shorter

last locust
#
load_bar=lambda s:(lambda g,b,l,k:[(l:=l+f'\033[38;2;0;{g};{b};1mโ–ˆ\033[0m',b:=b-k,g:=g+k, __import__('time').sleep(.1),print('\033[1A',end=''),print(l))for i in range(256//s)][-1][0])(0,256,'',s%256)
load_bar(2)โ€Š
```without redundant spaces  (-2 spaces)
unreal echo
#

golf this ```py
from inspect import signature
def fuckup(func):
@import('functools').wraps(func)
def _(a,**k):
return func(**dict((k,v
2 if import('random').random()>.5 else v)if not(isinstance(v, bool))else(k,0 if v else 1) for k, v in signature(func).bind(*a,**k).arguments.items()))
return _
def f(func):
@import('functools').wraps(func)
def i(*a,**k):
c={}
for i, v in signature(func).parameters.items():
if v.kind is v.POSITIONAL_OR_KEYWORD:
if v.annotation!=v.empty:
if not(isinstance(signature(func).bind(*a,**k).arguments[v.name], v.annotation)):c[v.name]=v.annotation(signature(func).bind(*a,**k).arguments[v.name])
else:c[v.name]=signature(func).bind(*a,**k).arguments[v.name]
else:c[v.name]=signature(func).bind(*a,**k).arguments[v.name]
else:c[v.name]=signature(func).bind(*a,**k).arguments[v.name]
return func(**c)
return i
class b(str):
@fuckup
@n
def format(s, b,f:int):
return b.str()*f

@print
@lambda a: b().format(*a)
@lambda x: (x.doc[0], x.doc[1])
class _:
doc=("101101010101", import('random').randint(0, 100)^7)```

heady pumice
#

oneline fizzbuzz (still trying to get rid of x, but don't think it's possible.)

print(*[("fizz" if x % 3 == 0 else "") + ("buzz" if x % 5 == 0 else "") or x for x in range(1, 101)])

output:

1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 23 fizz buzz 26 fizz 28 29 fizzbuzz 31 32 fizz 34 buzz fizz 37 38 fizz buzz 41 fizz 43 44 fizzbuzz 46 47 fizz 49 buzz fizz 52 53 fizz buzz 56 fizz 58 59 fizzbuzz 61 62 fizz 64 buzz fizz 67 68 fizz buzz 71 fizz 73 74 fizzbuzz 76 77 fizz 79 buzz fizz 82 83 fizz buzz 86 fizz 88 89 fizzbuzz 91 92 fizz 94 buzz fizz 97 98 fizz buzz
#

for prettier outputs

print("\n".join([("fizz" if x % 3 == 0 else "") + ("buzz" if x % 5 == 0 else "") or f"{x}" for x in range(1, 101)]))
rocky leaf
#

seems like the shortest possible but its 2 lines

#

i found this here

heady pumice
rocky leaf
#

[x%~2&4:12&8+x%~4]

#

what in the heck is that

#

~ what dis do

#

~

#

???

#

What is the Tilde ~ in Python? Python's Tilde ~n operator is the bitwise negation operator: it takes the number n as binary number and โ€œflipsโ€ all bits 0 to 1 and 1 to 0 to obtain the complement binary number. For example, the tilde operation ~1 becomes 0 and ~0 becomes 1 and ~101 becomes 010 .

#

what the fuck why

heady pumice
#

is for pure binary calculations

rocky leaf
#

for doing what?

heady pumice
#

magic

#

those are identical so the ~2 in this case is just there to prevent ()

print([i%~2&4 for i in range(0, 10)])
print([i%(-3)&4 for i in range(0, 10)])
rocky leaf
#

its shorthand for "not" in binary manipulations

#

not sure why I'd ever need that

heady pumice
#

to copy paste calculations from other languages

valid stream
#

i dont understand this

quartz wave
floral meteor
quartz wave
#

does exactly the same thing

#

you don't need ()

night quarryBOT
#

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

1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 FizzBuzz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 FizzBuzz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 FizzBuzz 61 62 Fizz 64 Buzz Fizz 67 68 Fizz Buzz 71 Fizz 73 74 FizzBuzz 76 77 Fizz 79 Buzz Fizz 82 83 Fizz Buzz 86 Fizz 88 89 FizzBuzz 91 92 Fizz 94 Buzz Fizz 97 98 Fizz Buzz
floral meteor
bronze agate
#

save yourself 2 characters by turning it from a comprehension to a regular for loop and letting each print happen on its own line

floral meteor
#

!e ```py
for x in range(1,101):print("FizzBuzz"[x%-3&4:12&8+x%-5]or x)

night quarryBOT
#

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

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

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

quartz wave
night quarryBOT
#

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

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

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

floral meteor
#

If only python had x++ like other languages

restive void
#

You can make ++x work, at least..

twin reef
versed eagle
#

yep, it will, bc you would have to hook unary +
though, unary + doesn't do much of anything lmao

sudden osprey
night quarryBOT
#

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

7
restive void
#

Just find some unused bit somewhere in the int object

twin reef
#

if you patch unary plus then type(+x) != int

#

and you can't really mock it because +(+x) shouldn't be equivalent to ++x

#

so you must break +x to make ++x work ๐Ÿ˜ฆ

restive void
#

!e

import fishhook, ctypes

@fishhook.hook(int)
def __pos__(self):
    refcount = ctypes.c_int.from_address(id(self))
    if refcount.value > 100000:
        refcount.value -= 100000
        ctypes.c_int.from_address(id(x) + int.__basicsize__).value += 1
    else:
        refcount.value += 100000
    return fishhook.orig(self)

x = 234234
print(x)
++x
print(x)
+x
print(x)
night quarryBOT
#

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

001 | 234234
002 | 234235
003 | 234235
restive void
#

:P

#

type(+x) is int, but +(+x) is equivalent to ++x. No way around that without changing grammar.

twin reef
#

oh wow thats smart

restive void
#

well.... but doing +x, and then +x again, it still does ++x.

#

(Also, never do this with any integer someone else uses.)

#

You could.... inspect the frame, get the source of your caller and manually check that there are two unary adds after each other in the bytecode..

twin reef
restive void
#

But hooking function call involves ugly things that break debuggers, etc.

twin reef
#

nah, no one cares

versed eagle
sudden osprey
#

!e
Not sure if this counts, or will even work on snekbox, but 3.11 makes this a bit easier (I just guessed this btw so it's probably wrong).

import inspect
class F():
    def __pos__(self):
        f = inspect.getframeinfo(inspect.currentframe().f_back)
        if f.code_context[0][f.positions.col_offset-1:].startswith("++"):
            print("double add")
        else:
            print("single add")
        return self
x = F()

++x
print("---")
+(+x)
night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 12, in <module>
003 |   File "<string>", line 5, in __pos__
004 | TypeError: 'NoneType' object is not subscriptable
sudden osprey
#

um

#

yeah I guess that isn't very reliable

languid hare
#

๐Ÿ˜†

quiet bone
#

How to print 1+1?

royal whale
quiet bone
#

Thx

quiet bone
#

Anyways

#

Doesnt matter

royal whale
#

that is simple

royal whale
quiet bone
#

/run

Def print1plus1():
        _1plus1=("1" + "+" + "1")
       Print(_1plus1)
quiet bone
royal whale
#

Ooh

#

sorry

#

๐Ÿ˜‚

#

I didn't understand

quiet bone
#

Ok

quiet bone
royal whale
#

I believe so

quiet bone
#

THEN.

#

DO IT FOR ME.

#

PLS.

versed eagle
#

!e

print("1+1")
night quarryBOT
#

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

1+1
versed eagle
#

it's not much of a challenge?

quiet bone
#

That looks normal

versed eagle
#

yes

#

and?

quiet bone
#

Do it

#

Esoteric

versed eagle
#

why

vague cairn
#

!e

one = 1
plus='+'
opo=f'{one} {plus} {one}'
print(opo)
print(exec(opo))
versed eagle
# quiet bone Do it

a. I'm on mobile rn so I don't feel like typing
b. this is a good opportunity for you to learn to do it esoterically yourself

quiet bone
#

I this esoteric

#

Just run it for me pls i dont know the boy

#

Bot*

vague cairn
#

Yeah, mobile is annoying.

royal whale
quiet bone
#

How to run code?

quiet bone
#

I gotta add stuff

royal whale
#

!e

_=__import__('s'.__add__('y'.__add__('s'))).stdout.write(int(True).__str__()+'+'+int(True).__str__()+'\n')
night quarryBOT
#

@royal whale :white_check_mark: Your 3.11 eval job has completed with return code 0.

1+1
versed eagle
royal whale
quiet bone
#

Ehy

#

Why*

versed eagle
#

you capitalized things

#

that shouldn't be capitalized

#

like "def"

royal whale
versed eagle
#

and "print"

quiet bone
#

Im on mobile

versed eagle
#

you can turn off autocapitalization

#

in your settings

quiet bone
#

Might this work?

unreal echo
#

what are you tring to do?

versed eagle
#

"Def" should be "def"

quiet bone
#

Can u fix it and run it for me

unreal echo
quiet bone
#

Run it

versed eagle
#

!e

(print((lambda:("1+1"))())if((_:=18)==18)else())
night quarryBOT
#

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

1+1
versed eagle
#

there
that's mildly esoteric

#

it's the best I can do while on mobile

restive void
#

!e

from ast import*
print(unparse(eval("Expr(value=BinOp(left=Constant(value=1), op=Add(), right=Constant(value=1)))")).replace(" ",""))
night quarryBOT
#

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

1+1
quiet bone
#

!e
jessyage = 18
_1plus1=0
def print1plus1():
global _1plus1
_1plus1=int("1" + "+" + "1")
str(_1plus1)
if jessyage == 18:
print(_1plus1)

night quarryBOT
#

@quiet bone :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 6, in <module>
003 | NameError: name '_1plus1' is not defined
quiet bone
#

!e
jessyage = 18
_1plus1=0
def print1plus1():
global _1plus1
_1plus1=int("1" + "+" + "1")
str(_1plus1)
if jessyage == 18:
print(_1plus1)

night quarryBOT
#

@quiet bone :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     _1plus1=int("1" + "+" + "1")
003 | IndentationError: unexpected indent
old socket
#

!e ```py
print(*map(chr,[(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1)),(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1)),(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))+(1and(1))]),sep="")

night quarryBOT
#

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

1+1
old socket
#

Not really esoteric though

versed eagle
old socket
versed eagle
#

true lol

#
[_:=0o0,[(_:=_+-~0o0)for __ in range(ascii_code_for_whatever_char_youre_making)],_][~0o0]```does functionally the same thing
old socket
#

Basically just a fanicer way of saying ascii_code_for_whatever_char_youre_making because it doensn't output a string you can copy and paste that does it

#

It just outputs the ascii_code_for_whatever_char_youre_making again

quiet bone
quiet bone
old socket
#

I cba

quiet bone
unreal echo
quiet bone
#

With who

unreal echo
#

with me

quiet bone
#

Cool

unreal echo
#

lemme start it up

quiet bone
#

Make the most esotericest of all of them

unreal echo
#

something with several layers of encoding and decoding along with adding a bunch of characters would take an hour, and i don't have that sort of time

#

i'll write a relatively small one

quiet bone
#

Ok

#

I think im about to get esoteric chills

#

Its like i feel them coming

unreal echo
#
__import__('sys').stdout.write(chr(int(list((lambda x: map(lambda i: f'{ord(i):b}', x))((lambda decimals: bytes(decimals).decode())((lambda binary: [int(byte, 2) for byte in list(binary)])((lambda text: ([bin(ord(i)).replace('b', '') for i in str(text)]))("".join(map(lambda i: i, (i for i in (lambda string: [i for i in str(string)])(''.join(map(lambda x: (lambda l: chr(l))(int(x, 2)), ['110001'])))))))))))[0], 2)))
@lambda j: (__import__('importlib').import_module('sys').stdout.write(j),exec(r"""exec('print(' + ''.join(map(chr, __import__('zlib').decompress(b'''x\x9ceP\xcd\x0e\x820\x0c~\x95\xc6K\xdb\x84\x10\xf0\xb8W!\x1e6\x98Z3\xc0\x8c\x1d \xc6w\xb7\x83\xe0O\xdc\xa9\xdd\xf7\xd3\xafm\xaf\x91dH\x14dJD\xc1\xf6\xae\xb30\x1b\xe8\xed}\xef\xc4\xc0\x19\x1fc\xecH\xd8\xb8\'\x1603\xbf\xb9\x9do\xa5\xb7a2\xe0\x96\xe4\'\xda{.\xb5\x1a;O_\\\'\x83\x8d\x8b\x81&O\xcc\xf4\x02\x8e\x0c\xe71\xaeZ\x90\x01\xd6\x18\x1b\x8dO\x1fa\xf2s2@\x8d"\xb4\x05\xe12\xfa{\xb0\xad\'t\x9a\x08q\xf3\x91l2\xa5HY\xa1\x0eL\x87Cy\x1bU\xf6\xbb\x90\x14@\xf2Q\xec\x88*e\xb8\xe4\x80\xbfn\xdb\x7fN\x84\xf8g\xa7\xd7\xda\xcb`\xa0\xd5\x83\x06\x9d\x9bW\x9c\xf3~\\@\x83u]UU\x8d\x1a\xe8\xfd\x9a\xea\xb4\xc2/z|x\xaa'''))) + ')')"""))
@lambda x: ''.join(chr(i) for i in x)  
@lambda _: map(lambda x: int(x, 2), _)
@lambda _: _.__delattr__(0)
class _:
    def __delattr__(self):
        return (lambda x: map(lambda i: f'{ord(i):b}', x))((lambda decimals: bytes(decimals).decode())((lambda binary: [int(byte, 2) for byte in list(binary)])((lambda text: ([bin(ord(i)).replace('b', '') for i in str(text)]))("".join(map(lambda i: i, (i for i in (lambda string: [i for i in str(string)])(''.join(map(lambda x: (lambda l: chr(l))(int(x, 2)), ['101011']))))))))))
#

there you go

#

@quiet bone

quiet bone
#

Masterpiece.

unreal echo
#

when was the .topic command last run?

restive void
unreal echo
royal whale
#

.topic

glass drumBOT
#
**What is the most esoteric code you've written?**

Suggest more topics here!

restive void
royal whale
#

ye

sick hound
#

!e

_ = [print,chr,int,(___:=(((_:=(([]==[])+([{}]!=[])))+(_<<_))+(__:=(~~([]==[])))+_+_+(_/_))*(_+_+_)+_/_),____:=(_i:=([{___}]==[{__}]))+___+_i+_i+_i+_i+_i+_i+_i+_i+_i+_i+_/_+_,(_____:=(__+_))*_____+____,(__+_+_+_+_+_+_+_+_+_+_+_+_)*_**_+__+_+__+__,(_+_+_+_+_<<_____>>__<<_<<_//_%_%_)*(__:=_-_)+_+__+____+_+_+_+__+_]
_[~~([]!=[])](_[[]==[]](_[__:=(~~([]==[])+([]==[]))](_[___:=~~([]==[])+([]==[])+~~([]==[])]))+_[[]==[]](_[__:=(~~([]==[])+([]==[]))](_[___+(~~([]==[]))]))+_[[]==[]](_[__:=(~~([]==[])+([]==[]))](_[___+__]))+_[[]==[]](_[__:=(~~([]==[])+([]==[]))](_[___+__+([]==[])]))+_[[]==[]](_[__:=(~~([]==[])+([]==[]))](_[___*__+(__//__)])))```
night quarryBOT
#

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

admin
unreal echo
#

can you explain exactly what the is going on

#

or at least parts of it

#

!e

night quarryBOT
#
Missing required argument

code

unreal echo
#

!e
print(~[])

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: bad operand type for unary ~: 'list'
quartz wave
#

not x is like this ```py
def not_func(x):
if x is True:
return False
if x is False or x is None:
return True
if hasattr(x, "bool"):
return x.bool() is False
if hasattr(x, "len"):
return x.len() == 0
return False

#

so it either calls __bool__ or __len__

floral meteor
#

!e ```py
@type.call
class nope:len=lambda s:0
if not nope:print("yep")

night quarryBOT
#

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

yep
floral meteor
#

!e ```py
from fishhook import*
nt = type(None)
hook(nt,'bool')(lambda s:True)
if None:print("nope")

night quarryBOT
#

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

[No output]
floral meteor
#

.topic

glass drumBOT
#
**What's your favorite Python hack?**

Suggest more topics here!

floral meteor
#

py_object or c_byte are probably the most convenient

halcyon garnet
#

i have a script, which makes an exec() call, and inside the exec is where my code goes

#

i need to suppress an exception globally (and add some handling)

#

similar to sys.excepthook, but making it so the program continues running

#

if anyones up to this, ping me for questions

unreal echo
halcyon garnet
#

run a hook function, then continue

unreal echo
#

no clue

halcyon garnet
#

the code that may error is in a while True loop

#

so it should just restart the loop

unreal echo
#

then you could just do py while True: with fuckit: code

halcyon garnet
#

or continue to the next statement, doesnt matter if they all error until the loop restarts

halcyon garnet
#

nor can i use third-party libraries

unreal echo
#

u-u-uh

#

gimme a few years

halcyon garnet
#

dont worry too much about it

#

ive got a half-good workaround fix already

halcyon garnet
#

i like modifying globals() and you cant stop me evil

old socket
#

Maybe, but segfault will

restive void
#

You can make some kind of try-except-pass for segfaults: before executing any line, fork. Wait for the child to die with segfault, then skip the line in the parent. When the child dies without a segfault, exit as well.

old socket
#

Sounds like you have a lot of experience with segfault

proper vault
#

so you essentially need to replace each raise with hook(Exception())?

floral meteor
#

I eat segfault for breakfast.

old socket
#

What an unhealthy breakfast

floral meteor
#

It's okay, I add a healthy seasoning of keyboard interrupt

fossil zodiac
#

hey, I am trying to make an eso lang using llvmlite. I got an .ll file but I cant make it into exe

TDLR: I did to make an .o file but I got .obj file!!! (3d file or some shiz)
llc -filetype=obj output.ll
then, I checked my "ls"
-a----        21/08/2022  12:15 PM            437 output.ll
-a----        21/08/2022  12:56 PM            687 output.obj

Then I did this anyway

gcc output.o -o output
gcc.exe: error: output.o: No such file or directory
gcc.exe: fatal error: no input files

what is the issue here? thanks

proper vault
#

@fossil zodiacthis is more a question for off topic

fossil zodiac
proper vault
#

ye, I understand the reasoning

fossil zodiac
#

got you! Cheers!

floral meteor
#

my snake game so dense, take this line for example

S.f().f().h=S[0,x//2,0,0].I(v=2,n=3,h=1)

"set two random food positions, then set head to left, half height, topleft panel, initialised as the head of a snake with length 3."

#

has a small chance of only spawning 1 food as a bethesda style bug/feature

floral meteor
#

ouch

#

you calling me short?

unreal echo
floral meteor
#

python can't overclock, can it?

#

I think my laptop is scared of my python scripts.

twin reef
#

disable gc, add -OO flag, patch some memory allocation related stuff

floral meteor
#

So it can, but only if you really try?

earnest wing
#

what do you even mean by "overclock"

#

that's a property of your hardware

vague cairn
#

If you're not using @contextlib.contextmanager or otherwise expecting anything to get garbage collected before the end of the program, you can use pypy.
It's not overclocking unless you've gone so meta that you're thinking of python as a machine instead of a virtual machine, but that's up to you...

fleet bridge
royal coral
#

!e

lambda:(
    (lambda x,y: x(y), (getattr,
        ((getattr, (
            __import__, "sys"), "stdout"
        )), "write"), "Olรก, mundo!")
)





import inspect 
def Dicria(expr: tuple):
   import types
   *to_list, = expr
   if isinstance(to_list[0], (types.FunctionType, types.BuiltinMethodType)):
       pass
   else:
       raise SyntaxError
   for index, element in enumerate(to_list):
       if isinstance(element, tuple):
           _ = Dicria(element)
           to_list[index] = _
   return to_list[0](*to_list[1:])



data = inspect.stack()[0].frame.f_code.co_consts[0]
    
import types

if isinstance(data, types.CodeType):
    _ = lambda:0
    _.__code__ = data
    Dicria(_())
else:
    print(0)
night quarryBOT
#

@royal coral :white_check_mark: Your 3.11 eval job has completed with return code 0.

Olรก, mundo!
royal coral
#

Huh

#

Maybe can improve it

burnt pasture
proper vault
#

not even using a combinator, I am disappointed.

burnt pasture
near gust
#

!e

__import__('sys').stdout.write(chr(int(list((lambda x: map(lambda i: f'{ord(i):b}', x))((lambda decimals: bytes(decimals).decode())((lambda binary: [int(byte, 2) for byte in list(binary)])((lambda text: ([bin(ord(i)).replace('b', '') for i in str(text)]))("".join(map(lambda i: i, (i for i in (lambda string: [i for i in str(string)])(''.join(map(lambda x: (lambda l: chr(l))(int(x, 2)), ['110001'])))))))))))[0], 2)))
@lambda j: (__import__('importlib').import_module('sys').stdout.write(j),exec(r"""exec('print(' + ''.join(map(chr, __import__('zlib').decompress(b'''x\x9ceP\xcd\x0e\x820\x0c~\x95\xc6K\xdb\x84\x10\xf0\xb8W!\x1e6\x98Z3\xc0\x8c\x1d \xc6w\xb7\x83\xe0O\xdc\xa9\xdd\xf7\xd3\xafm\xaf\x91dH\x14dJD\xc1\xf6\xae\xb30\x1b\xe8\xed}\xef\xc4\xc0\x19\x1fc\xecH\xd8\xb8\'\x1603\xbf\xb9\x9do\xa5\xb7a2\xe0\x96\xe4\'\xda{.\xb5\x1a;O_\\\'\x83\x8d\x8b\x81&O\xcc\xf4\x02\x8e\x0c\xe71\xaeZ\x90\x01\xd6\x18\x1b\x8dO\x1fa\xf2s2@\x8d"\xb4\x05\xe12\xfa{\xb0\xad\'t\x9a\x08q\xf3\x91l2\xa5HY\xa1\x0eL\x87Cy\x1bU\xf6\xbb\x90\x14@\xf2Q\xec\x88*e\xb8\xe4\x80\xbfn\xdb\x7fN\x84\xf8g\xa7\xd7\xda\xcb`\xa0\xd5\x83\x06\x9d\x9bW\x9c\xf3~\\@\x83u]UU\x8d\x1a\xe8\xfd\x9a\xea\xb4\xc2/z|x\xaa'''))) + ')')"""))
@lambda x: ''.join(chr(i) for i in x)  
@lambda _: map(lambda x: int(x, 2), _)
@lambda _: _.__delattr__(0)
class _:
    def __delattr__(self):
        return (lambda x: map(lambda i: f'{ord(i):b}', x))((lambda decimals: bytes(decimals).decode())((lambda binary: [int(byte, 2) for byte in list(binary)])((lambda text: ([bin(ord(i)).replace('b', '') for i in str(text)]))("".join(map(lambda i: i, (i for i in (lambda string: [i for i in str(string)])(''.join(map(lambda x: (lambda l: chr(l))(int(x, 2)), ['101011']))))))))))
night quarryBOT
#

@near gust :white_check_mark: Your 3.11 eval job has completed with return code 0.

1+1
urban cradle
earnest wing
#

wrong channel

unreal echo
#

How old was that

#

Like, 2 days ago

near gust
unreal echo
#

got a challenge for all those willing

#

sum up the steps/process of this code

#
from inspect import signature
def fuckup(func):
    @__import__('functools').wraps(func)
    def _(*a,**k):
        return func(**dict((k,v*2 if __import__('random').random()>.5 else v)if not(isinstance(v, bool))else(k,0 if v else 1) for k, v in signature(func).bind(*a,**k).arguments.items()))
    return _
def f(func):
    @__import__('functools').wraps(func)
    def i(*a,**k):
        c={}
        for i, v in signature(func).parameters.items():
            if v.kind is v.POSITIONAL_OR_KEYWORD:
                if v.annotation!=v.empty:
                    if not(isinstance(signature(func).bind(*a,**k).arguments[v.name], v.annotation)):c[v.name]=v.annotation(signature(func).bind(*a,**k).arguments[v.name])
                    else:c[v.name]=signature(func).bind(*a,**k).arguments[v.name]
                else:c[v.name]=signature(func).bind(*a,**k).arguments[v.name]
            else:c[v.name]=signature(func).bind(*a,**k).arguments[v.name]
        return func(**c)
    return i
class b(str):
    @fuckup
    @n
    def __format__(s, b,f:int):
        return b.__str__()*f
@print
@lambda a: b().__format__(*a)
@lambda x: (x.__doc__[0], x.__doc__[1])
class _:
    __doc__=("101101010101", __import__('random').randint(0, 100)^7)```
near gust
#

!e

print(len("00000000000000"))
night quarryBOT
#

@near gust :white_check_mark: Your 3.11 eval job has completed with return code 0.

14
soft vapor
#

Hey I just implemented an import system in my lang

#

Do any of you guys know a way to create a package registry

#

or a system like that?

#

And also a place to host it free

#

(I'm thinking of vercel)

twin reef
#

fuckup just randomly doubles non-bool arguments

#

f fixes the type of parameters if they don't fit type annotation

#

but it's not even helpful here

#

in your class b i assume you were trying to decorate __format__ with @f and not @n

#

so b().__format__ is just going to print b * f and sometimes double it

#

and class _ is just a way to call b().__format__ with that binary string and random number in some annoying interval

#

the code is not really obfuscated, so it's kinda not a challenge...

floral meteor
#

why use __doc__ when you can use x?

#

or another _?

#

this looks neater.

@print
@lambda _:b().__format__(*_._)
class _:_="101101010101", __import__('random').randint(0, 100)^7
twin reef
#
from random import*;print(f"{2901:b}"*(randint(0,100)^7)*randint(1,2))
grave rover
floral meteor
versed eagle
fleet bridge
#

run = lambda s: {...for _ in iter(lambda: bool(s:=s()),False)}
Im not sure if it is valid or correct code

versed eagle
#

darn it! I was typing my solution to it but I'm on mobile so I'm slow typer :(

fleet bridge
#

Im also on mobile)

versed eagle
fleet bridge
#

!e

run = lambda s: {...for _ in iter(lambda: bool(s:=s()),False)}
from dis import dis
dis(run)
night quarryBOT
#

@fleet bridge :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 | SyntaxError: assignment expression cannot be used in a comprehension iterable expression
fleet bridge
#

Reasonable

#

!e

run = lambda s: {(...,s:=s())[0]for _ in iter(lambda: bool(s), False)}
from dis import dis
dis(run)
versed eagle
#

my solution to that was s:=[s], then make s a default arg in the inner lambda, then s.append(s.pop()()) inside the iter lambda

night quarryBOT
#

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

001 |   1           0 LOAD_CLOSURE             0 (s)
002 |               2 BUILD_TUPLE              1
003 |               4 LOAD_CONST               1 (<code object <setcomp> at 0x7f35791ea1e0, file "<string>", line 1>)
004 |               6 LOAD_CONST               2 ('<lambda>.<locals>.<setcomp>')
005 |               8 MAKE_FUNCTION            8 (closure)
006 |              10 LOAD_GLOBAL              0 (iter)
007 |              12 LOAD_CLOSURE             0 (s)
008 |              14 BUILD_TUPLE              1
009 |              16 LOAD_CONST               3 (<code object <lambda> at 0x7f35791ea290, file "<string>", line 1>)
010 |              18 LOAD_CONST               4 ('<lambda>.<locals>.<lambda>')
011 |              20 MAKE_FUNCTION            8 (closure)
... (truncated - too many lines)

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

versed eagle
#

ty

versed eagle
fleet bridge
#
>>> run = lambda s: {(...,s:=s())[0]for _ in iter(lambda: bool(s), False)}
>>>
>>> run(int)
{Ellipsis}
>>> run(print)

{Ellipsis}
>>> run(lambda: print())

{Ellipsis}
>>> run(lambda: (print('first'), lambda: print('second'))[1])
first
second
{Ellipsis}

works in my 3.10 repl (now im on pc :-)

fleet bridge
#
>>> run = lambda _s: (lambda s: {(...,s.append(s.pop()()))[0] for _ in iter(lambda:bool(s[0]),False)})([_s])
>>> run(lambda: (print('first'), lambda: print('second'))[1])
first
second
{Ellipsis}
``` fixed
#

this can be useful when you are converting statements to expressions

versed eagle
#

wb metaclasses?

#

afaik it's not still like py2 where you can just give it a __metaclass__ attr in the type call

#

ig you could just instance the metaclass and add attrs to the instance after, but that just feels wrong

restive void
versed eagle
#

it accomplishes the desired behaviour, but it feels just so horribly wrong

restive void
versed eagle
#

basically, just make the __call__ method on the meta return something to simulate an instance of the class that has the metaclass

#

(sorry for long response time, i just got on my computer where i can respond more easily lol)

restive void
#

Isn't that the case already? Except it doesn't simulate. MyMetaclass("some name", (), {})() (which is the __call__ of the metaclass) returns an instance of that class which has this as its metaclass.

fleet bridge
#

does cls.__dunder__ = x set corresponding slot in c-structure of cls?

shrewd seal
#

So I came up with:

print(
    sum(
        items := (
            gather_items := (
                lambda lst: gather_items(lst + [float(new_string)])
                if (new_string := input(f"Enter item #{len(lst)+1}: ")) != "end"
                else lst
            )
        )([])
    )
    / len(items)
)
rugged sparrow
quartz wave
# shrewd seal So I came up with: ```python print( sum( items := ( gath...
print(
    print("Type 'end' when you want to end.") or
    "the average of the",
    length := len(items := (
            gather_items := (
                lambda lst: gather_items(lst + [float(new_string)])
                    if (new_string := input(f"Enter {(length := len(lst)+1)}{ {1:'st',2:'nd',3:'rd'}.get((length < 11 or length > 13) and length % 10,'th')} number: ")) != "end"
                    else lst
            )
        )([])
    ),
    f"number{'s' * (length != 1)} is",
    sum(items) / length
)
``` supposed to replicate the code's behaviour but with some grammar changes
wheat river
#

cheap discord rendering

floral meteor
floral meteor
#

Got bored and made random stuff

#

could add arrays and loops and call it turing complete.

fleet bridge
#

I think it is turing complete if there is long bignum arithmetic

#

Because infinite length number is bit array

fleet bridge
night quarryBOT
#

Hey @simple sphinx!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

simple sphinx
fleet bridge
#

lmao befunge

#

didnt expect to see befunge here

sick hound
#

That's 161 bytes

#

Challenge: shorten it ๐Ÿ‘€

polar plover
#

!remind 3H do this when not on phone

night quarryBOT
#
Sure thing!

Your reminder will arrive on <t:1661360160:F>!

floral meteor
frigid wharf
finite blaze
#
from pygame import*;t=m=310;x=event.get
while s:=(p:=display).set_mode((640,360)):x(256)and l;t-=x(768)and m or t>m or-1;draw.rect(s,"red",(0,t,50,50));p.flip()
#

i'll just post it

night quarryBOT
frigid wharf
#
from pygame import*;t=m=310;x=event.get;p=display
while 1:draw.rect(p.set_mode((640,360)),"red",(0,t,50,50));x(256)and l;t-=x(768)and m or t>m or-1;p.flip()```
upbeat sonnet
#

removed some unnecessary stuff

night quarryBOT
#
Bad argument

me is not a valid duration string.

#
Out of the question.

Sorry, you can't do that here!

unreal echo
#

implements javascript like for-loops

#

and i'll take the credit

#

xoxo thanks

floral meteor
#

@unreal echo You mean this?

gleaming maple
#
lst = ["aa", "bb", "cc"]
l = list(map(lambda u: 'from:' + u, lst))
' OR '.join(l)
# Get 'from:aa OR from:bb OR from:cc'

Is there a shorter way to do this tanks?

plush halo
#

!e (foo:=lambda: foo())()

night quarryBOT
#

@plush halo :x: Your 3.11 eval job has completed with return code 1.

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

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

from:aa OR from:bb OR from:cc
quartz wave
#

that happens because ints are cached in range(-5, 257)

plush halo
#

!e pp a = 256 b = 256 print(a is b) c = 257 d = 257 print(c is d)

night quarryBOT
#

@plush halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | True
002 | True
plush halo
#

!e py a = 256 b = 256 print(a is b) c = 258 d = 258 print(c is d)

night quarryBOT
#

@plush halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | True
002 | True
plush halo
#

lol

quartz wave
plush halo
#
>>> a = 256
>>> b = 256
>>> a is b
True
>>> c = 257
>>> d = 257
>>> c is d
False
quartz wave
#

works probably because the REPL has separate codes for each line that evaluate to the same namespace

plush halo
#

haha still getting the hang of it

#

!e py print(False == False in [False])

night quarryBOT
#

@plush halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

True
plush halo
#

!e py a = 5 b = 6 a ^= b b ^= a a ^= b print(a, b)

night quarryBOT
#

@plush halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

6 5
plush halo
#

!e py print(True == False == 0/0)

night quarryBOT
#

@plush halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

False
plush halo
#

this is quite fun ^^

quartz wave
#

!e ```py
True is False and when-it is False and when-it is not True

night quarryBOT
#

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

[No output]
quartz wave
#

!e ```py
1<0 is not False, 1>0 or ... is it

night quarryBOT
#

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

<string>:1: SyntaxWarning: "is not" with a literal. Did you mean "!="?
floral meteor
#

syntax warning should be an IDE thing not a code thing

#

!e ```py
from fishhook import hook
@hook(tuple)
def call(self, , __a=["Hello, World!\n"]):print(end=__a.pop(0));return()

() () () () () () () () () () () () () () ()

night quarryBOT
#

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

001 | <string>:5: SyntaxWarning: 'tuple' object is not callable; perhaps you missed a comma?
002 | Hello, World!
plush halo
#

!e ```py
import builtins
class foo:
def lshift(self, bar):
print(bar, end=''); return self
setattr(builtins, 'cout', foo())

####################
cout << "hello" << " " << "world"

night quarryBOT
#

@plush halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

hello world
floral meteor
#

yes

plush halo
#

i'll try it

#

thx

floral meteor
#

the author is a regular of this channel

quartz wave
floral meteor
#

*is

quartz wave
#

@snow beacon are you still alive

#

it's been 232 days

floral meteor
#

!e ```py
import sys,fishhook
@fishhook.hook(type(sys.stdout))
def lshift(self,other):print(end=other);return self
nl=chr(10)

(sys.stdout << "Hello, World").write(nl);

night quarryBOT
#

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

Hello, World
plush halo
#

๐Ÿ˜…

floral meteor
#

!e ```py
import sys,fishhook
@fishhook.hook(type(sys.stdout))
def lshift(self,other):print(end=other);return self
nl=chr(10)

sys.stdout << "Hello, World!" << nl;

night quarryBOT
#

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

Hello, World!
plush halo
#

nice... where can I read the documentation?

floral meteor
#

it should be builtin

#

!e ```py
import fishhook
print(fishhook.doc)

night quarryBOT
#

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

001 | 
002 | This module allows for swapping out the slot pointers contained in static
003 | classes with the `generic` slot pointers used by python for heap classes.
004 | This allows for assigning arbitrary python functions to static class dunders
005 | using `hook` and `hook_cls` and for applying new functionality to previously
006 | unused dunders. A hooked static dunder can be restored to original
007 | functionality using the `unhook` function
quartz wave
#

oh they put it in 3.11 now

floral meteor
#

!e ```py
from fishhook import hook
@hook(type(Ellipsis))
def index(self):return 0;
@hook(type(Ellipsis))
def getitem(self,whatever,__secret=["Hello, World!\n"]):print(end=__secret.pop(0));return[self]

[...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...]

night quarryBOT
#

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

001 | <string>:7: SyntaxWarning: list indices must be integers or slices, not ellipsis; perhaps you missed a comma?
002 | Hello, World!
floral meteor
#

Python tryna tell me I can't index with ellipsis

#

So I make indexing with ellipsis 29 times print hello world

floral meteor
snow beacon
plush halo
#

!e ```py
import this, sys
from fishhook import hook
@hook(type(print))
def call(*args, **kwargs):
...

night quarryBOT
#

@plush halo :x: Your 3.11 eval job has completed with return code 1.

001 | The Zen of Python, by Tim Peters
002 | 
003 | Beautiful is better than ugly.
004 | Explicit is better than implicit.
005 | Simple is better than complex.
006 | Complex is better than complicated.
007 | Flat is better than nested.
008 | Sparse is better than dense.
009 | Readability counts.
010 | Special cases aren't special enough to break the rules.
011 | Although practicality beats purity.
... (truncated - too many lines)

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

plush halo
#

weird... that stuff broke my ide

#

xD

floral meteor
#

I think you imported this to early

plush halo
#

probably

snow beacon
floral meteor
#

!e ```py
import sys as sus;from fishhook import hook
@hook(type(print))
def call(*a,**k):0
import this

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/snekbox/user_base/lib/python3.11/site-packages/fishhook/__init__.py", line 229, in pwrapper
004 |     hook_cls_from_cls(cls, type(f'<{itos(id(cls))}>', (P,), body), **kwargs)
005 |   File "/snekbox/user_base/lib/python3.11/site-packages/fishhook/__init__.py", line 186, in hook_cls_from_cls
006 |     update_subcls(subcls, pcls)
007 |   File "/snekbox/user_base/lib/python3.11/site-packages/fishhook/__init__.py", line 150, in update_subcls
008 |     for name in vars(pcls).keys() - key_blacklist:
009 |                 ^^^^^^^^^^^^^^^
010 | AttributeError: 'NoneType' object has no attribute 'keys'
plush halo
#

!e py import sys from fishhook import hook @hook(type(print)) def __call__(*args, **kwargs): ... import this

night quarryBOT
#

@plush halo :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 |   File "/snekbox/user_base/lib/python3.11/site-packages/fishhook/__init__.py", line 229, in pwrapper
004 |     hook_cls_from_cls(cls, type(f'<{itos(id(cls))}>', (P,), body), **kwargs)
005 |   File "/snekbox/user_base/lib/python3.11/site-packages/fishhook/__init__.py", line 186, in hook_cls_from_cls
006 |     update_subcls(subcls, pcls)
007 |   File "/snekbox/user_base/lib/python3.11/site-packages/fishhook/__init__.py", line 150, in update_subcls
008 |     for name in vars(pcls).keys() - key_blacklist:
009 |                 ^^^^^^^^^^^^^^^
010 | AttributeError: 'NoneType' object has no attribute 'keys'
snow beacon
plush halo
#

see lol

floral meteor
#

I beat you to it lol

plush halo
#

xD

floral meteor
#

wait why is sys imported?

plush halo
#

I was using it for smth else... it's rly not needed

#

I'm going to feel guilty reading the zen of python after this

floral meteor
floral meteor
#

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

s = """Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!"""
corrupt(s)
print(s)

night quarryBOT
#

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

001 | Bea5uif5m i3!be4uer tha.!ug,z.
002 | ypl)dit is "ftt%s t(bn )npl)dit.
003 | Si-qle is "ftt%s t(bn #pmp,fx.
004 | Com0mex is "ftt%s t(bn #pmp,jca4fd.
005 | Fla4!is bet4fr 4ian nes4fd.
006 | Spa2te )t b%ute2!th!o d%ose.
007 | Re!eab)mit9!co5ots.
008 | Sp%dia,!ca3fs !sen't s0fci!m e.pug(!to bre!l t(f r5mes.
009 | Al4iou'i p2bct)dal)uy "fat3!pu2jty.
010 | Er2prs sho5md .fve2!pa3t s)men4my.
011 | Unl%ts %ypl)dit,z s)men#fd.
... (truncated - too many lines)

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

floral meteor
#

it is not a reversible operation.

snow beacon
#

Before I go, there's a site that has some cool obfuscated code in Python and other languages, some written by myself. It's an archive of competition entries for an unrelated discord server https://cg.esolangs.gay

quartz wave
#

competition?

snow beacon
#

It's mostly an excuse to write weird code, but the description is on the info page of the site. It's a game. I just thought it might provide an alternate source for what Python I get up to.

quartz wave
#

ok

#

also i see rocketrace

snow beacon
#

I'm off now. Possibly another 200 days, we'll see.

quartz wave
#

ok goodbye
thx for confirming you're still alive

plush halo
#

@floral meteor I tried corrupt with the encrypted version of s...

floral meteor
plush halo
#

!e ```py
import builtins
tmp, builtins.print = builtins.print, lambda *args, **kwargs: None
import this
builtins.print = tmp; del tmp; s = this.s

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

corrupt(s)
print(s)

night quarryBOT
#

@plush halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Gur Mra bs mgu"b, /m G6{ C2hre&
002 | O2ohg6thy vf /sgg2f g5oa (uyl.
003 | Rk#zvp6h v&!or'hre gun!!vz#zvp6h.
004 | wzc9s v&!or'hre gun!!pb:dyr+/
005 | P"{cy2l v&!or'hre gun!!pb:dyv0ogr1/
006 | S9og 6g o2hgr%!gu.b a2ggr1/
007 | F#oef2!vf org'se 'vna qra&s.
008 | snq.pvy6hl 0cha'g.
009 | drp6oy 0ofr&!ne2b'g fcr0wny rab(uu 'c o%snx gur ehy2g.
010 | zgu"itu cen0hvp.zvg,!or.hf #iev'm.
011 | feb%g f5chy1!ar)se #off fvy2bgy,/
... (truncated - too many lines)

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

plush halo
#

now, I wont feel guilty anymore xD

plush halo
#

rip lol

floral meteor
#

what module?

plush halo
floral meteor
#

It doesn't modify the code of the module, so it's not permanent beyond runtime

plush halo
#

i see

earnest wing
quartz wave
earnest wing
unreal echo
#

getting a py_object from id(obj)+8 is the object in memory right? what is id(obj)+16

restive void
unreal echo
#

oh okay

#

+16?

restive void
#

I think the size? But I don't remember

unreal echo
#

id(obj) is the object place in memory then, right?

restive void
#

I mean, yes, kind of? But the value at id(obj) is the refcount

unreal echo
#

how do i interact with the object in memory itself then?

earnest wing
#

all of it is the object

#

they're just struct fields, byte offsets in memory

quartz wave
# unreal echo how do i interact with the object in memory itself then?
 _________________  # OPTIONAL
|____ _ob_next ___| ## id(obj), PyObject*/py_object
|____ _ob_prev ___| ## id(obj) + tuple.__itemsize__, PyObject*/py_object
|_________________| # REQUIRED
|___ ob_refcnt ___| ## id(obj) + object.__basicsize__ - tuple.__itemsize__ * 2, Py_ssize_t/c_ssize_t
|____ ob_type ____| ## id(obj) + object.__basicsize__ - tuple.__itemsize__, PyObject*/py_object
|______ ... ______|
#

the part below REQUIRED is the one you'll often see

fleet bridge
# floral meteor !e ```py from ctypes import c_char def corrupt(victim): l = len(victim) type...

I can't understand why it works

  1. saving ptr to type of string and string data array
  2. changing string type to to int
  3. a = victim + 1
  4. copy int digits from a to victim
  5. changing type of victim to str back

I think i understand all steps correctly, but i cant understand why it all works how it works. int+1 can change only several digits at the end of integer, not some random digits inside of it

fleet bridge
quartz wave
#

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

s = """Bea5uif5m i3!be4uer tha.!ug,z.
ypl)dit is "ftt%s t(bn )npl)dit.
Si-qle is "ftt%s t(bn #pmp,fx.
Com0mex is "ftt%s t(bn #pmp,jca4fd.
Fla4!is bet4fr 4ian nes4fd.
Spa2te )t b%ute2!th!o d%ose.
Re!eab)mit9!co5ots.
Sp%dia,!ca3fs !sen't s0fci!m e.pug(!to bre!l t(f r5mes.
Al4iou'i p2bct)dal)uy "fat3!pu2jty.
Er2prs sho5md .fve2!pa3t s)men4my.
Unl%ts %ypl)dit,z s)men#fd.
In 4ie &bce of !nbi'vit9- r%gus%!th%!te-qta4jon to 'ves3/
T(fre sho5md "f o.f-- and pre&fra"my /oly one --o"wio5t w!z t/!do it.
Alt(pug(!th!u w!z m!z n/u b%!ob6jou3!at fir3u u.mes3!yo5(re Dut#i.
pw )t b%ute2!th!o n%wer.
Al4iou'i n%wer is /gte.!be4uer tha.!ri'it .pw.
If 4ie )npl%nen4bti/o i3!ha2e t/!ex0mai.- i4(s !!ba$!id%b.
g t(f i-qle-fnt!uio.!is eas9!to exp,bin, it may be !!go/e i$fa.
Nam%tpa#fs !se /oe (pnk)og 'sea4!id%b -- le4(s $p m/se /g t(pse!"""
corrupt(s)
print(s)

night quarryBOT
#

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

001 | Bea5uif5m i3!be4uer tha.!ug,z.
002 | ypl)dit is "ftt%s t(bn )npl)dit.
003 | Si-qle is "ftt%s t(bn #pmp,fx.
004 | Com0mex is "ftt%s t(bn #pmp,jca4fd.
005 | Fla4!is bet4fr 4ian nes4fd.
006 | Spa2te )t b%ute2!th!o d%ose.
007 | Re!eab)mit9!co5ots.
008 | Sp%dia,!ca3fs !sen't s0fci!m e.pug(!to bre!l t(f r5mes.
009 | Al4iou'i p2bct)dal)uy "fat3!pu2jty.
010 | Er2prs sho5md .fve2!pa3t s)men4my.
011 | Unl%ts %ypl)dit,z s)men#fd.
... (truncated - too many lines)

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

quartz wave
#

@fleet bridge i don't think so

fleet bridge
#

No, i mean you should do +1 to corrupt and -1 to uncorrupt

quartz wave
fleet bridge
#

Right

#

Ok then i dont understand what is happening
Ctypes kills my brain

floral meteor
#

Alright prepare for your brain to be explode

languid night
#

๐Ÿ˜Ÿ

floral meteor
#

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

s = """Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!"""
corrupt(s)
print(s)

night quarryBOT
#

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

001 | Bea5uif5m i3!be4uer tha.!ug,z.
002 | ypl)dit is "ftt%s t(bn )npl)dit.
003 | Si-qle is "ftt%s t(bn #pmp,fx.
004 | Com0mex is "ftt%s t(bn #pmp,jca4fd.
005 | Fla4!is bet4fr 4ian nes4fd.
006 | Spa2te )t b%ute2!th!o d%ose.
007 | Re!eab)mit9!co5ots.
008 | Sp%dia,!ca3fs !sen't s0fci!m e.pug(!to bre!l t(f r5mes.
009 | Al4iou'i p2bct)dal)uy "fat3!pu2jty.
010 | Er2prs sho5md .fve2!pa3t s)men4my.
011 | Unl%ts %ypl)dit,z s)men#fd.
... (truncated - too many lines)

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

floral meteor
#

+0 works

#

And it doesn't work without the + 0

#

It's because the integers are stored as base 30 number system in a 32 bit sizes, so digits that aren't valid are distorted.

#

When a new integer is created from the data using + 0

versed eagle
quartz wave
#

python integers are base 2**30

#

can be customized to be base 2**15

versed eagle
#

oh, 2**30
i thought it was literally base 30

floral meteor
#

Meant to say 2**30

#

Or 8**10

floral meteor
#

golfing challenge: print this matrix.

floral meteor
#

!e I've got```py
r=range;print('[\n'+',\n'.join(map(str,[[i^j for i in r(16)]for j in r(16)]))+'\n]')

night quarryBOT
#

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

001 | [
002 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
003 | [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14]
004 | [2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13]
005 | [3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12]
006 | [4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11]
007 | [5, 4, 7, 6, 1, 0, 3, 2, 13, 12, 15, 14, 9, 8, 11, 10]
008 | [6, 7, 4, 5, 2, 3, 0, 1, 14, 15, 12, 13, 10, 11, 8, 9]
009 | [7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8]
010 | [8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7]
011 | [9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 3, 2, 5, 4, 7, 6]
... (truncated - too many lines)

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

floral meteor
#

This fractal at higher resolution

#

the code for the fractal ```py
r=range;print('\n'.join(map(lambda s:''.join([*map(lambda a:f'\x1b[48;2;{(255//32)*a};0;0m \x1b[m',s)]),[[i^j for i in r(32)]for j in r(32)])))

#

the code for the mirror ```py
print('\n'.join(map(lambda s:''.join([*map(lambda a:f'\x1b[48;2;{(255//32)*a};0;0m \x1b[m',s)]),[[(i&j)|((31-i)&(31-j))for i in r(32)]for j in r(32)])))

earnest wing
#

this would be quite detailed if it was actual pixel output

floral meteor
#

another cursed fractal

r=range;print('\n'.join(map(lambda*q:''.join([*map(lambda r,g,b:((k:=r*g*b+38+b),f'\x1b[48;2;{255//32*r+k};{255//32*g+k};{255//32*b+2*k}m  \x1b[m')[1],*q)]),[[i^j for i in r(32)]for j in r(32)],[[(i&j)|((31-i)&(31-j))for i in r(32)]for j in r(32)],[[i&j for i in r(32)]for j in r(32)])))
floral meteor
earnest wing
#

I was talking like actual graphical output instead of terminal fun ๐Ÿ˜„

loud sail
#

hi guys

floral meteor
#

Hi lad

loud sail
#

could u refer me to a page to get basic help for python

floral meteor
#

anywhere but here

loud sail
#

do u have a channel i nmind

#

would really appreciate it lol

floral meteor
#

I learnt python in university without a single textbook I don't know how others learn python, someone else answer?

loud sail
#

well i know how to code

#

i just dont know hwy this syntax is wrong

#

even tho it looks right

earnest wing
#

I notice you're on help cooldown.

floral meteor
#

This is the channel where the syntax looks wrong but it is right

earnest wing
#

So subverting that cooldown by asking in nonhelp channels probably won't help you out a lot lol

#

but hey if you as @floral meteor you might get a fun answer involving ctypes

floral meteor
loud sail
#

ctypes?

floral meteor
floral meteor
#

ctypes gives access to the internals so you can fidget with the interpeter as you go. But it's like fixing a car while you're driving it

loud sail
#

๐Ÿ˜ด for a easy problem

floral meteor
floral meteor
#

it was just simple syntaxerror

loud sail
#

thats what i said lol

floral meteor
loud sail
#

lol

#

i dont wanna know whatu used this for

#

lol

#

actually what u use it for

#

mans a tricky a person

#

im just curious

#

since i can read your code

#

how good are you at leet code if you ever seen it @floral meteor

#

or can i not compare them?

floral meteor
#

I haven't dabbled in the dark arts of leetcode yet

earnest wing
#

lol leetcode

floral meteor
# loud sail since i can read your code

!e my code is not readable ```py
from ctypes import*;
class output:
def init(self,victim):self.victim=id(victim);ol=len(victim);(c_charol).from_address(id(victim)+48)[:]=[0]ol;c_longlong.from_address(id(victim)+16).value=0;
def lt(self,item):_l=c_longlong.from_address(self.victim+16);_l.value+=1;_a=c_byte.from_address(self.victim+48+_l.value);_a.value=-item;return 0;
neg=lambda s:s;
def gt(self,a):a,i,_l=a,c_longlong.from_address(self.victim+16);data=(c_byte_l.value).from_address(self.victim+49);v,data[:-1]=data;l.value-=1;a[i]=v;return 0;
class array:
def init(self,victim):self.memory="\0\0\0\0\0\0\0\0"[:]*256;
=self.memory=id(self.memory);c_longlong.from_address(+16).value=256
8-1;self.i=0;self.o=output(victim)
@property
def mem(self):return(c_byte
(256
8-1)).from_address(self.memory+48);
def inc(self):self.mem[self.i]+=1;return 0;
def dec(self):self.mem[self.i]-=1;return 0;
def left(self):self.i-=1;return 0;
def rite(self):self.i+=1;return 0;
def dot(self):return self.o <- self.mem[self.i];
def com(self):return(self.mem,self.i) <- self.o;
def loop(self):return+(not self.mem[self.i]);
def endl(self):return-bool(self.mem[self.i]);
def iter(self):return iter([self.mem]);
def _get(self,c,p):
if not 0<=p<len(c):raise StopIteration;
return c[p];
def run(self,c):
p=t=0;s=type('',(),{'iter':lambda s:s,'next':lambda s:self._get(c,p)})();
try:
for k in s:t=t+(k=='[')-(k==']')if t else{'+':self.inc,'-':self.dec,'<':self.left,'>':self.rite,'.':self.dot,',':self.com,'[':self.loop,']':self.endl}.get(k,lambda
:0)();p+=1-2*(t<0);
except:0;
finally:return self.o;
def brainfuck(victim,,_n=[0]):clone,a=victim+'.',array(victim);a.run(clone);_l=c_longlong.from_address(a.o.victim+16);l=_l.value;_l.value-=1;data=(c_bytel).from_address(a.o.victim+48);_,*data[:-1]=data;import('sys')._getframe(1).f_globals[_n[0]]=a.o;_n[0]+=1;return 0;
...;
code="++++++++++[>+++++++>+++++++++++>+++<<<-]++++++++++>++>--.>++.<.<.>-------.,..+++.>++++++++++++.,.+<<+++++++++++++++.>.+++.,.--------.>.<<<.";
print(code);
brainfuck(code);
print(code);

night quarryBOT
#

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

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

yes, but I overcomplicated it by using native memory

loud sail
#

whats native memory

floral meteor
#

the memory allocated to the python interpreter

rugged sparrow
#

python's native allocator will be the death of me

loud sail
#

does everyone write like this?

rugged sparrow
#

so many bugs are trickier to exploit because of it

floral meteor
#

no, just this obscure corner of wherever we are

loud sail
#

hmm

#

why do u do this then

#

if its not useful

proper vault
loud sail
#

or is it just to make complex code work

#

like u said

rugged sparrow
#

@floral meteor i found more C level bugs in python btw

floral meteor
loud sail
#

how long did u guys code for

night quarryBOT
#

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

001 | bytearray: bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
002 | leaked memory of buffer: [1, 140539191971648, 8, 9, 140539181891952, 140539181891952, 0]
loud sail
#

i hope i can get to your level in 3 months

#

maybe 1 month

#

idk depending on how much time i have

#

ill see u guys again soon

#

gn

proper vault
fleet bridge
#

If you are interested i can draw it in wolfram mathematica

floral meteor
#

yes

coarse oyster
#

!e

print(', '.join(str(i) for i in {i*j for (i, j) in [(i, j) for i in range(2, 10) for j in range(2, 10)] if i*j%2 == 0}))

is this a little bit esoteric?

night quarryBOT
#

@coarse oyster :white_check_mark: Your 3.11 eval job has completed with return code 0.

4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 28, 30, 32, 36, 40, 42, 48, 54, 56, 64, 72
languid night
#

Not really

coarse oyster
#

!e

print(', '.join(str(i) for i in {i*j for (i, j) in [(i, j) for i in range(__import__('random').randint(0, 2), __import__('random').randint(2, 10)) for j in range(__import__('random').randint(0, 2), __import__('random').randint(2, 10))] if i*j%2 == 0}))

maybe this?

night quarryBOT
#

@coarse oyster :white_check_mark: Your 3.11 eval job has completed with return code 0.

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 30
coarse oyster
#

what is really esoteric

restive void
unreal echo
rugged sparrow
#

its an offset. so +48 is looking at the 6th pointer of the object, assuming a 64bit system

floral meteor
#

If a string is entirely ascii, it will store its bytes at position 6 in the object structure. It's 71 or 72 for higher value bytes

rain edge
#
import sys
sys.stdout.write("hello world")
sick hound
#

(actually, are social media posts allowed?)
I'll publish the code for this later, whenever I'm finished cleaning this up,

floral meteor
night quarryBOT
#

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

Hello, World!
sick hound
#

I hate that I can read all of this

floral meteor
#

you want something you can't read?

sick hound
#

maybe I don't

floral meteor
#

it doesn't just interpret the string, it hacks the string and directly brainfucks it

quartz wave
#

!e ```py
from sys import _getframe as _gf,stdout,stderr

class IOStreamAttribute:
dictionary={}
def new(cls,name,stream,dict_=dictionary,ns="nul"):
if name in dict_:
return dict_[name]
res=dict_[name]=super().new(cls)
res.name=name
res.stream=stream
res.is_read=stream and 'r' in stream.mode
res.dict_=dict_
res.ns=ns
return res
def lshift(self,value):
if self.is_read is True:
raise NotImplementedError
if value is self.dict_.get("endl"):
self.stream.write("\n")
self.stream.flush()
else:
self.stream.write(value)
return self
def str(self):
return f"{self.ns!r}[::{self.name!s}]"
def repr(self):
return f"IOStreamAttribute({self.name!r})"

@lambda c: c()
class std:
def getitem(self,x):
if type(x) is slice and x.start is x.stop is None:
return x.step
def repr(self):
return "std"

cout=IOStreamAttribute("cout",stdout,ns=std)
cerr=IOStreamAttribute("cerr",stderr,ns=std)
endl=IOStreamAttribute("endl",None,ns=std)

std[::cout] << "stdout" << (std[::cerr] << "stderr\n" and "") << std[::endl]

rain edge
#

def __init__ (self,victim)

#

What

#

Even

floral meteor
#

why is it right shift?

night quarryBOT
#

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

stdoutstderr
quartz wave
#

why is it flushed

floral meteor
#

toilet noises

floral meteor
#

\n is like pressing that button on the toilet

quartz wave
#

!e ```py
from sys import _getframe as _gf,stdout,stderr

class IOStreamAttribute:
dictionary={}
def new(cls,name,stream,dict_=dictionary,ns="nul"):
if name in dict_:
return dict_[name]
res=dict_[name]=super().new(cls)
res.name=name
res.stream=stream
res.is_read=stream and 'r' in stream.mode
res.dict_=dict_
res.ns=ns
return res
def lshift(self,value):
if self.is_read is True:
raise NotImplementedError
if value is self.dict_.get("endl"):
self.stream.write("\n")
self.stream.flush()
else:
self.stream.write(value)
return self
def str(self):
return f"{self.ns!r}[::{self.name!s}]"
def repr(self):
return f"IOStreamAttribute({self.name!r})"

@lambda c: c()
class std:
def getitem(self,x):
if type(x) is slice and x.start is x.stop is None:
return x.step
def repr(self):
return "std"

cout=IOStreamAttribute("cout",stdout,ns=std)
cerr=IOStreamAttribute("cerr",stderr,ns=std)
endl=IOStreamAttribute("endl",None,ns=std)

std[::cout] << "stdout" << (std[::cerr] << "stderr" and "") << std[::endl]

night quarryBOT
#

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

stdoutstderr
quartz wave
#

@floral meteor doesn't work if i remove it

floral meteor
#

you also sent endl which think is also \n

quartz wave
#

works fine on the REPL ```py

std[::cout] << "stdout" << (std[::cerr] << "stderr\n" and "") << std[::endl]
stderr
stdout

sick hound
floral meteor
#

I did do a whitespace purge on the first class, before I did that it was quite easy to follow

#

relatively

floral meteor
#

whitespace is for the weak.

#

just like sleep is for the weak

sick hound
#

get rid of the indentation and newlines then

quartz wave
#

@sick hound ah yes this is what you're looking for

sick hound
#

lol nice

night quarryBOT
sick hound
#

a

floral meteor
#

bruh. That is a beautiful form of obfuscation

#

what does it do?

sick hound
#

does a write syscall to stdout

floral meteor
#

name is None

#

somewhere

#

in ctypes

sick hound
#

huh,

floral meteor
#
Traceback (most recent call last):
  File "<stdin>", line 192, in <module>
  File "%PYTHONROOT%\python39\lib\ctypes\__init__.py", line 364, in __init__
    if '/' in name or '\\' in name:
TypeError: argument of type 'NoneType' is not iterable
sick hound
#

ah, windows

#

this probably only works on unix

floral meteor
#

platform incompatibility

#

nice style though

sick hound
#

thanks, I should try remaking it too there's a c := in the middle of it I got too lazy to obfuscate out

peak kestrel
unique heath
#

!e

print(eval("\65\76\61\6C\28\22\68\65\6C\6C\6F\22\29"))```
night quarryBOT
#

@unique heath :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1
004 |     5>1C885CCF9
005 |        ^
006 | SyntaxError: invalid non-printable character U+0006
unique heath
#

rip

floral meteor
#

!e ```py
print("\x65\x76\x61\x6C\x28\x22\x68\x65\x6C\x6C\x6F\x22\x29")

night quarryBOT
#

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

eval("hello")
floral meteor
#

NameError: name 'hello' is not defined

rocky leaf
#
it = you = True ; are = print
are ( you, it )

if False is True:
    are ( you, False or are (you, it) )
else:
    are (you,True or False)
    for i in str(you):
        are(you,True)
rapid sparrow
royal patrol
rapid sparrow
#

im still amazed that it all basically worked lol

royal patrol
#

xD yep same

rapid sparrow
#

need to find some other nasty exe to unpack and decompile

royal patrol
#

basically now it can decompile complex code and large files

#

which is good

rapid sparrow
#

i think that i do have one

royal patrol
#

i have plenty as well

rapid sparrow
#

it might be py39 tho ๐Ÿ’€๐Ÿ’€

royal patrol
#

try it

#

it was supposed to be compatible till 3.10

#

so will be a good chance

#

to test

rapid sparrow
serene stratus
#

Thanks, always welcome to reverse engineer the paid modes with me ๐Ÿ˜„

rapid sparrow
#

i remember when i first saw from pytransform import _transform or some such thing

serene stratus
#

Could definitely use an extra set of brains

rapid sparrow
#

and some horriffic native code call

#

i couldnt even execute the .so on the machine i was using to look at the time so i was kinda stuck then

rapid sparrow
rapid sparrow
royal patrol
serene stratus
#

Well starting from 1 September school starts from me so I'll be busy from then on

#

Still I'd like to help when I can

rapid sparrow
#

ahhh our schedules ๐Ÿ’€๐Ÿ’€

#

well i can work whenever because i have a slack-friendly job lol

serene stratus
#

I wish

rapid sparrow
serene stratus
#

Yup

rapid sparrow
#

and @royal patrol you are gonna be less busy than now ?

royal patrol
#

gonna be more busy lol, cuz the semester begins soon after the admission and the entrance tests ends

rapid sparrow
#

oh i thought it was too good to be true lol

royal patrol
#

xDDDD

plush halo
#
def get_resp(foo=[]):
    foo.append('really')
    return input(f"Do you {' '.join(foo)} want to know?\n>>> ")

print('How to keep a fool busy for hours')
while not get_resp().strip().lower().startswith('n'):
    continue
print('Now you know :)')
#
How to keep a fool busy for hours
Do you really want to know?
>>> maybe
Do you really really want to know?
>>> umm...
Do you really really really want to know?
>>> cmon I really do
Do you really really really really want to know?
>>> pleaseeeee
Do you really really really really really want to know?
>>> yesssssss i freekin doooo
Do you really really really really really really want to know?
>>> ahh pretty please
Do you really really really really really really really want to know?
>>> fine
Do you really really really really really really really really want to know?
>>> nah I give up
Now you know :)
quartz wave
quartz wave
restive void
#

I mean.. it's not wrong

#

!e

from dis import dis
dis("5<7 and print('lol')")
dis("(5<7 and print)('lol')")
night quarryBOT
#

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

001 |   0           0 RESUME                   0
002 | 
003 |   1           2 LOAD_CONST               0 (5)
004 |               4 LOAD_CONST               1 (7)
005 |               6 COMPARE_OP               0 (<)
006 |              12 JUMP_IF_FALSE_OR_POP    11 (to 36)
007 |              14 PUSH_NULL
008 |              16 LOAD_NAME                0 (print)
009 |              18 LOAD_CONST               2 ('lol')
010 |              20 PRECALL                  1
011 |              24 CALL                     1
... (truncated - too many lines)

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

restive void
#

Ok, it does produce different bytecode

#

In 3.10 the bytecode is basically identical though.

quartz wave
near gust
#

h

floral meteor
#

h

#

wait wrong server

floral meteor
royal patrol
#

it happens everytime with "==" and "not in" and "in" stuffs

fleet bridge
night quarryBOT
#

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

001 |   1           0 LOAD_CONST               0 (5)
002 |               2 LOAD_CONST               1 (7)
003 |               4 COMPARE_OP               0 (<)
004 |               6 JUMP_IF_FALSE_OR_POP     8 (to 16)
005 |               8 LOAD_NAME                0 (print)
006 |              10 LOAD_CONST               2 ('lol')
007 |              12 CALL_FUNCTION            1
008 |              14 RETURN_VALUE
009 |         >>   16 RETURN_VALUE
010 |   1           0 LOAD_CONST               0 (5)
011 |               2 LOAD_CONST               1 (7)
... (truncated - too many lines)

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

fleet bridge
#

Same code, but in 3.10

earnest wing
#
class Foo:
    @infix("^-^")
    def foo(self, other):
        return f"hi, {other}!"
    
class Bar:
    @infix("^-^", flipped=True)
    def bar(self, other):
        return f"hello there, {other}!"

print(Foo() ^-^ "foo") # output: hi, foo!
print("bar" ^-^ Bar()) # output: hello there, bar!
print("foo" ^-^ "bar") # raises TypeError
minor topaz
quartz wave
royal patrol
royal patrol
quartz wave
#

nvm doesn't do anything

royal patrol
#

oh try now

quartz wave
royal patrol
#

without - 1

#

sorry for the issue

burnt cedar
#

Please don't use that kind of language here.

royal patrol
#

is stupid ok?

quartz wave
royal patrol
#

ima fix that soon

royal patrol
quartz wave
quartz wave
royal patrol
#

have asked @rapid sparrow to split it into multiple files :/

#

so its easier to look instead of scrolling 1000 lines of code

quartz wave
royal patrol
quartz wave
#

idk if it breaks anything else

royal patrol
#

;-;

#

causes an infinite IMPORT_NAME loop

#

lets see what is going wrong

quartz wave
#

can you give example code

royal patrol
#

wait

quartz wave
#

also i have like an hour before school starts and i haven't even taken a shower yet

royal patrol
#

ima send ya the pyc file if u need in dms

quartz wave
upbeat sonnet
#

!e

night quarryBOT
#
Missing required argument

code

#
Command Help

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

*Run Python code and get the results.

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

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

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

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

upbeat sonnet
#

!invite

#

well dang

rapid sparrow
rapid sparrow
rapid sparrow
#

3745 line file ๐Ÿ’€๐Ÿ’€

royal patrol
earnest wing
unique heath
#

!e

class Foo:
    @infix("^-^")
    def foo(self, other):
        return f"hi, {other}!"
    
class Bar:
    @infix("^-^", flipped=True)
    def bar(self, other):
        returnf "hello there, {other}!"

print(Foo() ^-^ "foo") # output: hi, foo!
print("bar" ^-^ Bar()) # output: hello there, bar!
print("foo" ^-^ "bar")```
night quarryBOT
#

@unique heath :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 9
002 |     returnf "hello there, {other}!"
003 |             ^^^^^^^^^^^^^^^^^^^^^^^
004 | SyntaxError: invalid syntax
quartz wave
quartz wave