#esoteric-python

1 messages · Page 112 of 1

toxic jewel
#

only takes one argument tho

viscid nymph
toxic jewel
#

not sure

viscid nymph
#
>>> import sys
>>> sys.stdout is sys.__stdout__
True
viscid nymph
#
decorator(lambda: ...)
simple crystal
#

you can't

viscid nymph
#

Not with the @

#

Because @ is only for classes and functions

#

Oh that's what you meant

simple crystal
#

that's using a lambda as a decorator

viscid nymph
#

!e

@lambda f: print(f.__name__, f())
def foo():
    return "lol"
night quarryBOT
#

@viscid nymph :white_check_mark: Your eval job has completed with return code 0.

foo lol
simple crystal
#

since 3.8

#

any expression can be a decorator

viscid nymph
#

As long as its callable and can take one argument

astral rover
simple crystal
#

ty for corrections

toxic jewel
#

!e

@print
@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().set(a)))([]))
class a:...
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 |   File "<string>", line 2, in <lambda>
004 |   File "<string>", line 2, in <lambda>
005 | AttributeError: 'dict' object has no attribute 'set'
toxic jewel
#

!e print(globals().dir())

night quarryBOT
#

@toxic jewel :white_check_mark: Your eval job has completed with return code 0.

['__repr__', '__hash__', '__getattribute__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__iter__', '__init__', '__or__', '__ror__', '__ior__', '__len__', '__getitem__', '__setitem__', '__delitem__', '__contains__', '__new__', '__sizeof__', 'get', 'setdefault', 'pop', 'popitem', 'keys', 'items', 'values', 'update', 'fromkeys', 'clear', 'copy', '__reversed__', '__class_getitem__', '__doc__', '__str__', '__setattr__', '__delattr__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__dir__', '__class__']
viscid nymph
#

it's a dict

toxic jewel
#

isnt there a way to add to globals

viscid nymph
#

!e

globals()['x'] = 'lol'
print(x)
night quarryBOT
#

@viscid nymph :white_check_mark: Your eval job has completed with return code 0.

lol
toxic jewel
#

oh

#

!e

@print
@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals()["test"]:=a))([]))
class a:...
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     @lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals()["test"]:=a))([]))
003 |                                                             ^
004 | SyntaxError: cannot use assignment expressions with subscript
viscid nymph
#
globals().__setitem__('test', a)or a
toxic jewel
#

why or a

viscid nymph
#

I thought you wanted the value idk

toxic jewel
#

true

#

but why outside parentheses

viscid nymph
#

I was doing the exact same thing globals()["test"]:=a would do but without the syntax error

night quarryBOT
#

@toxic jewel :white_check_mark: Your eval job has completed with return code 0.

([None], [<class '__main__.a'>])
toxic jewel
#

!e

@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().__setitem__('test',a)or a))([]))
@lambda*uwu:(globals().__setitem__('o', (globals().get('test').__str__()[1])))
class a:...

print(o)
night quarryBOT
#

@toxic jewel :white_check_mark: Your eval job has completed with return code 0.

o
toxic jewel
#

it hurts

#

!e

@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().__setitem__('test',a)or a))([]))
@lambda*uwu:(globals().__setitem__('o', (globals().get('test').__str__()[1])))
@lambda*uwu:(lambda a:(lambda v:(v.append(o)))((globals().__setitem__('_list', a)))([]))
class a:...

print(x for x in _list__)

night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 |   File "<string>", line 3, in <lambda>
004 |   File "<string>", line 3, in <lambda>
005 |   File "<string>", line 3, in <lambda>
006 | AttributeError: 'NoneType' object has no attribute 'append'
royal siren
#

wtf is that function

toxic jewel
#

i dont know anymore

#

i just want to print o

#

from a list

#

!e

@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().__setitem__('test',a)or a))([]))
@lambda*uwu:(globals().__setitem__('o', (globals().get('test').__str__()[1])))
@lambda*uwu:(lambda a:(lambda v:(v.append(o)))((globals().__setitem__('_list', a)))([]))
class a:...

print(x for x in _list)

night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

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

!e

list1 = ['hi', 'hi', 'hi', 'hi', 'hi', 'hi', 'hi', 'hi']
print(i for i in list1)
night quarryBOT
#

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

<generator object <genexpr> at 0x7efd0001d6d0>
royal siren
#

WTF

toxic jewel
#

what

#

hope i didnt mess anything up

royal siren
#

!e ```
print("you suck at eval")

night quarryBOT
#

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

you suck at eval
royal siren
#

lmao

#

!e print("i am a bot and i suck at eval")

night quarryBOT
#

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

i am a bot and i suck at eval
naive roost
#

each evaluation is in its own read-only file system sandbox, don't worry about breaking it

toxic jewel
#

its painful

#

globals are painful

royal siren
#

~e print(i for i in range(15))

#

~e print(i for i in range(15))

#

wtf wrong prefix aagh

#

!e print(i for i in range(15))

night quarryBOT
#

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

<generator object <genexpr> at 0x7faddeb496d0>
royal siren
#

WTF

naive roost
#

if you want to just play with the bot, please go to #bot-commands

toxic jewel
#

!e

@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().__setitem__('test',a)or a))([]))
@lambda*uwu:(globals().__setitem__('o', (globals().get('test').__str__()[1])))
@lambda*uwu:(lambda a:(lambda v:(v.append(o)))((globals().__setitem__('_list', a)))([])
class a:...

print(x for x in globals().get('_list'))

night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 4
002 |     class a:...
003 |     ^
004 | SyntaxError: invalid syntax
royal siren
#

!e

for i in range(15):
  print("lol")
night quarryBOT
#

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

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

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

royal siren
#

lolololol

naive roost
#

also, make sure you understand the decorator evaluation order before playing with those kinds of things

toxic jewel
#

understand code!?! optional!!!!

naive roost
#

maybe clarify your decorators first, and make them esoteric after you've made them work

toxic jewel
#

i just need to append o to a list inside a decorator but i guess im just bad now

#

my main goal was to have owo and then join them

naive roost
#

to make esoteric code effectively, you really need to understand the underlying python evaluation 😅

toxic jewel
#

yeah

#

im trying to learn globals()

royal siren
#

lol

#

!e print(globals())

night quarryBOT
#

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

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

lol

toxic jewel
#

too bad globals().get('variable') doesnt return the variable but just returns None

naive roost
#

!e ```py
x = 5
print(globals()['x'])

night quarryBOT
#

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

5
toxic jewel
#

oh yeah wait

naive roost
#

globals() is just the dictionary of global variables, and, as for each dictionary, .get(value, default=None) returns default if value is not in the dictionary

toxic jewel
#

!e

@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().__setitem__('test',a)or a))([]))
@lambda*uwu:(globals().__setitem__('o', (globals().get('test').__str__()[1])))
@lambda*uwu:(lambda a:(lambda v:(v.append(o)))((globals().__setitem__('_list', a)))([]))
class a:...

print(x for x in globals()['_list'])
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 6, in <module>
003 | KeyError: '_list'
#

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

3 + 90 = 93
toxic jewel
#

i have never felt more lied to.

naive roost
#

there's also setdefault if you want to set a default value in your dictionary

#

!e py globals().setdefault('x', 5) print(x) globals().setdefault('x', 10) print(x)

night quarryBOT
#

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

001 | 5
002 | 5
naive roost
#

might be useful

toxic jewel
#

hm

#

!e

@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().__setitem__('test',a)or a))([]))
@lambda*uwu:(globals().__setitem__('o', (globals().get('test').__str__()[1])))
@lambda*uwu:(lambda a:(lambda v:(v.append(o)))((globals().setdefault('_list', a)))([]))
class a:...

print(x for x in globals()['_list'])
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 6, in <module>
003 | KeyError: '_list'
naive roost
#

you might want to use globals().get, though, to not have a KeyError

toxic jewel
#

hold on'

naive roost
#

it will return None as a default if you don't specify it, though

toxic jewel
#

!e

@lambda*uwu:((lambda a:([a.append(owo)for(owo)in(uwu)], globals().__setitem__('test',a)or a))([]))
@lambda*uwu:(globals().__setitem__('o', (globals().get('test').__str__()[1])))
@lambda*uwu:(lambda a:(lambda v:(v.append(o)))((globals().setdefault('_list', a)))([]))
@lambda*uwu:(print(_list))
class a:...

print(x for x in globals()['_list'])
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 5, in <module>
003 |   File "<string>", line 4, in <lambda>
004 | NameError: name '_list' is not defined
naive roost
#

!e py print(globals().setdefault('x', 10))

night quarryBOT
#

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

10
toxic jewel
#

codingis hard

naive roost
#

!e py print(globals().__setitem__('x', 10))

night quarryBOT
#

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

None
naive roost
#

right, that's partially what I was expecting

toxic jewel
#

wait

#

maybe a is none

#

wait nvm

snow beacon
#

I started on a guide/wiki, but only got as far as whitespace.

toxic jewel
#

!e

print(
    globals().get(
        (lambda x: return x)(globals().__setitem__('v',1))
        ))
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     (lambda x: return x)(globals().__setitem__('v',1))
003 |                ^
004 | SyntaxError: invalid syntax
toxic jewel
#

eruhg

#

wait huh

#

!e

def↹function(*args,**kwargs):
↹↹↹↹return↹*args,**kwargs

function("lol")
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     def↹function(*args,**kwargs):
003 |        ^
004 | SyntaxError: invalid character '↹' (U+21B9)
toxic jewel
#

i have never felt more lied to

snow beacon
#

You were meant to use actual tabs, not the placeholders.

snow beacon
#

Lambdas implicitly return.

toxic jewel
#

!e

@lambda*v:...
class v:...
night quarryBOT
#

@toxic jewel :warning: Your eval job has completed with return code 0.

[No output]
toxic jewel
#

replit just must not like me\

snow beacon
#

It's probably using Python 3.8.

naive roost
#

the restricted syntax on decorators was relaxed with Python 3.9

snow beacon
#

You can do ```python
identity = lambda x: x
@identity(lambda v:...)
class v:...

#

The identity function does nothing, but the syntax likes it because it has a name.

naive roost
#

also, your previous code is weird, because globals()[None] is a KeyError

snow beacon
#

Where does it index globals with None?

naive roost
#

globals().__setitem__('v',1) returns None

snow beacon
#

globals().get returns None if the key isn't found.

floral meteor
# toxic jewel

You know you can also do .update({'_list':a}) if setitem is too painful XD

#

Or to set multiple values

#

Alright I'm on phone but I will try to make python code that does exactly what it does when evaluated in brainfuck

#

Prepare to suffer from PTSD

#

Ah well I accidentally backspaced and phone got no ctrlz

#

I'm gonna plug my laptop in

#

derp here we go. So I'm gonna try to emulate the following:

[-][python init here]
++++++++++
[
  >+++++
  <-
][,,,,,,,,,,,,,,,,,,,,XD]
>++.
--.--.
floral meteor
#

!e ```py
#[-][
@lambda :()
class :
input,en_in="",True
B=2<<2
def init(s):
s.i=s.o=2>>2
s.a=[s.i]*((2<<s.o)s.B)
def pos(s):
s.o += 1
return s
def neg(s):
s.o -= 1
return s
def add(s,o):
s.a[s.i] += +(s.o,setattr(s,'o',0))[0]+ 1
s.a[s.i] %= 2
s.B
return s
def sub(s,o):
s.o =- +s.o+ 1
s.a[s.i] -= (s.o,setattr(s,'o',0))[False]
s.a[s.i] %= 2**s.B
return s
def getattr(s,a):
try:return object.getattr(s,a)
except:return print(end=chr(s.a[s.i]))or s
def getitem(s,f):
if type(f)==type(lambda:None):
while s.a[s.i]:f()
elif f is s:
if s.o:s.a[s.i]=s.o=0
elif s.a[s.i]:raise RecursionError
elif type(f)is tuple:s(f)
elif f is...:s .
._ ._
return s
def gt(s,o):
s.i += 1
s.a.extend([0]* (s.i- +len(s.a)+ 1))
return s
def lt(s,o):
if s.i:s.i -= 1
else:s.a.insert(0,0)
return s
def rshift(s,o):
s>o
return s>o
def lshift(s,o):
s<o
return s<o
def call(s,*a):
s.a[s.i]=ord(s.input and [s.input.pop(False)for i in range( +len(a)+ -True)][-True]or '\0'if s.en_in else import('sys').stdin.read( +len(a)+ -True)[-True])
return s
#] I think I covered all the bases
([-][]++++++++++)[
lambda:((>)+++++ <)-_
]>;(((++).--).--).

night quarryBOT
#

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

420
floral meteor
#

I MADE THE BOT EVALUATE STRAIGHT BRAINFUCK MWAHAHAHAHAHAHAHA

chilly sun
#

can someone help me with this simple coding pls?

floral meteor
#

this is neither simple coding nor a help channel

fallow plaza
#

eval ?

floral meteor
#

!e ```py
#[-][
@lambda :()
class :
input,en_in="",True
B=2<<2
def init(s):
s.i=s.o=2>>2
s.a=[s.i]*((2<<s.o)s.B)
def pos(s):
s.o += 1
return s
def neg(s):
s.o -= 1
return s
def add(s,o):
s.a[s.i] += +(s.o,setattr(s,'o',0))[0]+ 1
s.a[s.i] %= 2
s.B
return s
def sub(s,o):
s.o =- +s.o+ 1
s.a[s.i] -= (s.o,setattr(s,'o',0))[False]
s.a[s.i] %= 2**s.B
return s
def getattr(s,a):
try:return object.getattr(s,a)
except:return print(end=chr(s.a[s.i]))or s
def getitem(s,f):
if type(f)==type(lambda:None):
while s.a[s.i]:f()
elif f is s:
if s.o:s.a[s.i]=s.o=0
elif s.a[s.i]:raise RecursionError
elif type(f)is tuple:s(f)
elif f is...:s .
._ ._
return s
def gt(s,o):
s.i += 1
s.a.extend([0]* (s.i- +len(s.a)+ 1))
return s
def lt(s,o):
if s.i:s.i -= 1
else:s.a.insert(0,0)
return s
def rshift(s,o):
s>o
return s>o
def lshift(s,o):
s<o
return s<o
def call(s,*a):
s.a[s.i]=ord(s.input and [s.input.pop(False)for i in range( +len(a)+ -True)][-True]or '\0'if s.en_in else import('sys').stdin.read( +len(a)+ -True)[-True])
return s
#] I think I covered all the bases
(++++++++++)[
lambda:(((((>)++++++++++)>)+++++++++++>)+++<<<)-
]>_
(>>)++_
<<
(++++).---
.>_
(--)..
(+++).>
(.<)++++++++
(.--------).+++_
(.<)+++++++
.--------_
(.>>)+
.

night quarryBOT
#

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

hello world!
hollow kiln
#

!e

def decor(func):
    def outer_wrapper():
        def inner_wrapper():
            def super_inner_wrapper():
                def ultra_inner_wrapper():
                    def extreme_advanced_wrapper():
                        def final_level_wrapper_executor():
                            def super_final_level_wrapper_executor():
                                print('wrapper executed')
                                func()
                            return super_final_level_wrapper_executor
                        return final_level_wrapper_executor()
                    return extreme_advanced_wrapper()
                return ultra_inner_wrapper()
            return super_inner_wrapper()
        return inner_wrapper()
    return outer_wrapper()
@decor
def hello():
    extra_decor()
@decor
def extra_decor():
    hello()
@decor
def extra_extra_decor():
    hello()
@decor foo():
    extra_extra_decor()
foo()
night quarryBOT
#

@hollow kiln :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 27
002 |     @decor foo():
003 |            ^
004 | SyntaxError: invalid syntax
hollow kiln
#

👀 damg

#

!e

def decor(func):
    def outer_wrapper():
        def inner_wrapper():
            def super_inner_wrapper():
                def ultra_inner_wrapper():
                    def extreme_advanced_wrapper():
                        def final_level_wrapper_executor():
                            def super_final_level_wrapper_executor():
                                print('wrapper executed')
                                func()
                            return super_final_level_wrapper_executor
                        return final_level_wrapper_executor()
                    return extreme_advanced_wrapper()
                return ultra_inner_wrapper()
            return super_inner_wrapper()
        return inner_wrapper()
    return outer_wrapper()
@decor
def hello():
    extra_decor()
@decor
def extra_decor():
    hello()
@decor
def extra_extra_decor():
    hello()
@decor 
foo():
    extra_extra_decor()
foo()
night quarryBOT
#

@hollow kiln :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 28
002 |     foo():
003 |     ^
004 | SyntaxError: invalid syntax
hollow kiln
#

ahhhahHSH

#

!e

def decor(func):
    def outer_wrapper():
        def inner_wrapper():
            def super_inner_wrapper():
                def ultra_inner_wrapper():
                    def extreme_advanced_wrapper():
                        def final_level_wrapper_executor():
                            def super_final_level_wrapper_executor():
                                print('wrapper executed')
                                func()
                            return super_final_level_wrapper_executor
                        return final_level_wrapper_executor()
                    return extreme_advanced_wrapper()
                return ultra_inner_wrapper()
            return super_inner_wrapper()
        return inner_wrapper()
    return outer_wrapper()
@decor
def hello():
    extra_decor()
@decor
def extra_decor():
    hello()
@decor
def extra_extra_decor():
    hello()
@decor 
def foo():
    extra_extra_decor()
foo()
night quarryBOT
#

@hollow kiln :x: Your eval job has completed with return code 1.

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

Full output: too long to upload

hollow kiln
#

🥴

#

lmao

mild spire
#

Can someone help me with an exam

snow beacon
sudden willow
#

im aware im planning on answering the questions as esoterically as possible

#

!e

@lambda*u: v := lambda: print('hi')
@v()
class a:...
night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     @lambda*u: v := lambda: print('hi')
003 |      ^
004 | SyntaxError: cannot use assignment expressions with lambda
sudden willow
#

interesting

#

!e

@lambda *u: globals().__setitem__('v', lambda: print('hi'))
@lambda *u: globals().get('v')
class a:...
night quarryBOT
#

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

[No output]
rugged sparrow
#

@sudden willow think about the order that decorators are ran

sudden willow
#

yea

rugged sparrow
#

you get set_v(v(cls))

sudden willow
#

it seems globals() doesn't update until after

#

sadge

rugged sparrow
#

no v is getting called before set_v

sudden willow
#

wait you're right

rugged sparrow
#

!e py @v @lambda c:globals().__setitem__('v', lambda f:print('hi')) class a:pass

night quarryBOT
#

@rugged sparrow :x: Your eval job has completed with return code 1.

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

hmm

sudden willow
#

!e

@lambda c:globals()['v']()
@lambda c:globals().__setitem__('v', lambda f:print('hi'))
class a:pass
rugged sparrow
#

!e ```py
def set_v(f):
global v
v = lambda f:print('hi')

@v
@set_v
class c:pass```

night quarryBOT
#

@rugged sparrow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 5, in <module>
003 | NameError: name 'v' is not defined
rugged sparrow
#

hmm

night quarryBOT
#

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

[No output]
bitter iris
#

Python first loads v and set_v respectively and then calls them

#

from the reverse order

rugged sparrow
#

oh it loads them both before calling

bitter iris
#

yep

rugged sparrow
#

ah

sudden willow
#

interesting

rugged sparrow
#

ooh i can use decorator syntax to put things on the c vm stack

bitter iris
#

this is good for linear evaluation (so that we don't have to push/pop stuff)

sudden willow
#

!e

@lambda c:globals()['v']('a')
@lambda c:globals().__setitem__('v', lambda f:print('hi'))
class a:pass
night quarryBOT
#

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

hi
sudden willow
#

nice

#

so decorators go from bottom to top?

#

wasn't aware of that

rugged sparrow
#
  2           0 LOAD_CONST               0 (1)
  3           2 LOAD_CONST               1 (2)
  4           4 LOAD_CONST               2 (3)
  5           6 LOAD_BUILD_CLASS
              8 LOAD_CONST               3 (<code object a at 0x7f88b9b6b710>)
             10 LOAD_CONST               4 ('a')
             12 MAKE_FUNCTION            0
             14 LOAD_CONST               4 ('a')
             16 CALL_FUNCTION            2 <-- my metaclass is ran here
             18 CALL_FUNCTION            1
             20 CALL_FUNCTION            1
             22 CALL_FUNCTION            1``` i could totally use this to pull those items off the stack with a meta class
sudden willow
#

not too sure what that is but looks cool!

rugged sparrow
#

its the dis of py @1 @2 @3 class a:pass

sudden willow
#

nice

#

wait hold on

#

!e

@lambda v: print(3)
@lambda v: print(2)
@lambda v: print(1)
class   v:...
night quarryBOT
#

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

001 | 1
002 | 2
003 | 3
sudden willow
#

nice

#

@lambda v: 1

night quarryBOT
#

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

<function femboys at 0x7fbc25123940>
sudden willow
#

hm

#

halal

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 | TypeError: 'tuple' object is not callable
sudden willow
#

r isnt a function

#

its a variable

#

!e

@lambda f: print(f)
class   v: ...
night quarryBOT
#

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

<class '__main__.v'>
sudden willow
#

!e

@lambda f : (f, 1)
def test():
 pass
print(test.__class__())
night quarryBOT
#

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

()
sudden willow
#

you're making the function a tuple

#

print is NoneType

#

because print returns none

#

!e

print(print())
night quarryBOT
#

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

001 | 
002 | None
sudden willow
#

i'm not sure what you're trying to achieve

snow beacon
#

!e ```py
@print
@print
def foo():()

night quarryBOT
#

@snow beacon :white_check_mark: Your eval job has completed with return code 0.

001 | <function foo at 0x7f7ff2efa040>
002 | None
snow beacon
#

The first print returns None for the second to print.

#

Well, other way around...

naive roost
#

basically, what you have is foo = print(print(foo)), with the first print returning None

rugged sparrow
#

!e ```py
from ctypes import *
import sys
import dis

pythonapi.Py_IncRef.argtypes=[py_object]

class Singleton(type):
def new(self, name, bases, body):
frame = sys._getframe(1)
segment = frame.f_code.co_code[frame.f_lasti + 2:]
num_decos = 0
for op, arg in zip(segment[::2], segment[1::2]):
if op == dis.opmap['CALL_FUNCTION'] and arg == 1:
num_decos += 1
else:
break
stacktop = POINTER(py_object).from_address(id(frame) + sizeof(c_void_p) * 8)
args = stacktop[:num_decos]
for idx in range(num_decos):
f = lambda c:c
pythonapi.Py_IncRef(f)
stacktop[idx] = f
cls = super().new(self.base, name, bases, body)
return cls(*args)

@1
@2
@(1,2,3)
class instance(metaclass=Singleton):
def init(self, *initial_values):
print('instance initialized with', *initial_values)
self.args = initial_values

def __repr__(self):
    return f'instance{self.args}'

print(instance)```

night quarryBOT
#

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

001 | instance initialized with 1 2 (1, 2, 3)
002 | instance(1, 2, (1, 2, 3))
naive roost
#

interesting

sudden willow
#

hmm

#

!e

globals().__setitem__('>w<', print('>w<'))
>w<
night quarryBOT
#

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

001 |   File "<string>", line 2
002 |     >w<
003 |     ^
004 | SyntaxError: invalid syntax
sudden willow
#

is there a dunder for the ^ operator?

rugged sparrow
#

__xor__

sudden willow
#

alright beearebee

#

!e

O=type('',(),{'__xor__':1})()
o=O()

o^o
night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: '' object is not callable
sudden willow
#

i may be dumb

#

!e

class O:
    def __xor__(*o):
        pass

o = O()

o^o
night quarryBOT
#

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

[No output]
dire yew
toxic jewel
#

!e lambda lambda: lambda

night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     lambda lambda: lambda
003 |            ^
004 | SyntaxError: invalid syntax
sudden willow
#

fixed the character readability issue so now its not just hi

#

!e

@lambda c:globals()['v']((chr(111),chr(119),chr(111)))
@lambda c:globals().__setitem__('v', lambda v:print(''.join(c for c in v)))
class   c:pass
night quarryBOT
#

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

owo
sudden willow
#

wait

#

!e

@lambda c:globals()['v']([104, 105])
@lambda c:globals().__setitem__('v', lambda v:print(''.join(chr(c) for c in v)))
class   c:pass
night quarryBOT
#

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

hi
sudden willow
#

nice

#

wait

#

!e

@lambda c:globals()['v'](104 | 105)
@lambda c:globals().__setitem__('v', lambda *v:print(''.join(chr(c) for c in *v)))
class   c:pass
night quarryBOT
#

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

001 |   File "<string>", line 2
002 |     @lambda c:globals().__setitem__('v', lambda *v:print(''.join(chr(c) for c in *v)))
003 |                                                                                  ^
004 | SyntaxError: invalid syntax
sudden willow
#

hmm

#

!e

@lambda c:globals()['v'](104, 105)
@lambda c:globals().__setitem__('v', lambda *v:print(''.join(chr(c) for c in *v))))
class   c:pass
night quarryBOT
#

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

001 |   File "<string>", line 2
002 |     @lambda c:globals().__setitem__('v', lambda *v:print(''.join(chr(c) for c in *v))))
003 |                                                                                  ^
004 | SyntaxError: invalid syntax
sudden willow
#

what

#

help

viscid nymph
#

Why *v

sudden willow
#

because using another list/tuple is broing

#

and i wanna use *v

viscid nymph
#

But why are you unpacking it

sudden willow
#

wouldnt it return like a list/tuple else

viscid nymph
#
(x for x in *y)

Is invalid syntax

(x for x in y)

Is valid syntax

sudden willow
#

oh yeah wait

#

!e

@lambda c:globals()['v']((104 & 105))
@lambda c:globals().__setitem__('v', lambda *v:print(''.join(chr(c) for c in v)))
class   c:pass
#

nice

#

lmao

viscid nymph
#

Lol

night quarryBOT
#

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

h
sudden willow
#

strange

#

i would think & would return both values

viscid nymph
#

!e

print(104 | 105, 104 & 105)
night quarryBOT
#

@viscid nymph :white_check_mark: Your eval job has completed with return code 0.

105 104
sudden willow
#

so i assume | chooses the highest/truthiest value and & chooses first

viscid nymph
sudden willow
#

ik bitwise

#

or most of them

#

i learnt | today

#

wasn't aware that was a thing

sick hound
#

| keeps the smallest 1, & removes it

#

!e ```python
print(104 or 105, 104 and 105)

night quarryBOT
#

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

104 105
sick hound
#

or returns the first true value (or false if no true values)
and returns the last value (or false if any are false)

sick hound
#

that's why you can do stuff like

def fibonacci(n):
    return [
        ((i==n-1 and (x:=(x[i-1] + x[i-2]))) \
        or (i==0 and (x:=[1,1])) \
        or x.append(x[i] + x[i-1])) \
        if n>2 else (x:=1)\
        for i in range(0,n)] \
        and x
sick hound
sick hound
#

!e (1<<198,)*47

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | MemoryError
sick hound
#

haha

#

!e py (1<<19**8,)*4**7

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | MemoryError
sick hound
#

!e (lamda a,b,c:print(a);print(b);print(c);)(1,2,3)

night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     (lamda a,b,c:print(a);print(b);print(c);)(1,2,3)
003 |            ^
004 | SyntaxError: invalid syntax
sick hound
#

!e lambda t:print("sex");a=true;print(a && t())

night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     lambda t:print("sex");a=true;print(a && t())
003 |                                           ^
004 | SyntaxError: invalid syntax
sick hound
#

!e lambda t:print("sex");a=true;print(a and t())

night quarryBOT
#

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

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

!e lambda t:print("sex");a=True;a and t()

night quarryBOT
#

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

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

!e t=lambda:print("sex");a=True;a and t()

night quarryBOT
#

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

sex
sick hound
#

whats the weirdest way to do an if statement

#

what I did

#

"a and t()"

#

if a is true run the t function

#

ok bet

vestal solstice
#

exec("t()"*bool(a))

sick hound
#

brilliant

floral meteor
#

a and t() i usually prefer over the if statement.
Why?

r = a and t() and 4 or 2

instead of

r=2
if a:
  if t():
    r=4
#

now behold as i brainfuck in python

toxic jewel
floral meteor
toxic jewel
#

yea

floral meteor
#

or...

#

"if it's not four, go left, print and erase and return, else go right"

toxic jewel
#

brainfuck in python

#

cute

viscid nymph
floral meteor
#

this code does exactly the same thing in both a python and brainfuck interpeters

sick hound
#

what is the underscore?

viscid nymph
#

The last output

#

In the repl

sick hound
#

no the underscores in the code

#

that is not a brainfuck instruction iirc

floral meteor
#

it's a massive class full of dunders in order to make python interpret it.

#

underscores are ignored by brainfuck

sick hound
#

oh

floral meteor
#

hence allowing them and curved parenthesis, and pretty much any non-brainfuck character to be used to make the script compatible with python

#
#[-][
@lambda _:_()
class _:
 input,en_in="",True
 B=2<<2
 __eq__,__ne__=lambda s,o:s,lambda s,o:[setattr(s,'input',o),setattr(s,'en_in',True)]if o is not None else[setattr(s,'input',""),s9etattr(s,'en_in',False)]
 __bool__=lambda s:()==()
 __int__=lambda s:s.a[s.i]
 __str__=lambda s:chr(int(s))
 __repr__=lambda s:f"\n<{s.i}: {int(s)}>"
 def __init__(s):
  s.i=s.o=2>>2
  s.a=[s.i] *((2<<s.o)**s.B* 1)
 def __pos__(s):
  s.o += 1
  return s
 def __neg__(s):
  s.o -= 1
  return s
 def __add__(s,o):
  s.a[s.i] += +(s.o,setattr(s,'o',0))[0]+ 1
  s.a[s.i] %= 2**s.B
  return s
 def __sub__(s,o):
  s.o      =- +s.o+ 1
  s.a[s.i] -= (s.o,setattr(s,'o',0))[False]
  s.a[s.i] %= 2**s.B
  return s
 def __getattr__(s,a):
  try:return object.__getattr__(s,a)
  except:return print(end=str(s))or s
 def __getitem__(s,f):
  if type(f)==type(lambda:None):
   while int(s):f()
  elif f is s:
   if s.o:s.a[s.i]=s.o=0
   elif int(s):raise RecursionError
  elif type(f)is tuple:s(f)
  return s
 def __gt__(s,o):
  s.i += 1
  s.a.extend([0]* (s.i- +len(s.a)+ 1))
  return s
 def __lt__(s,o):
  if s.i:s.i -= 1
  else:s.a.insert(0,0)
  return s
 def __rshift__(s,o):
  s>o
  return s>o
 def __lshift__(s,o):
  s<o
  return s<o
 def __call__(s,*a):
  if len(a)>1:s.a[s.i]=ord(s.input and[s.input.pop(False)for i in range( +len(a)+ -True)][-True]or '\0'if s.en_in else __import__('sys').stdin.read( +len(a)+ -True)[-True])
  elif a is...:(print(s),print(s),print(s),)
  return s
#] I think I covered all the bases
sick hound
#

lmaoo so cursed

dire inlet
#

I do not consider this code here to be "esoteric" this is normal code

#

@sick hound

sick hound
#

how

dire inlet
#

it just is lol

sick hound
#

this is definitely not how normal people write code

#

lel

dire inlet
#

they are just weird

toxic jewel
#

wdym

floral meteor
#

you telling me that is not esoteric?

dire inlet
#

yes normal

#

yes

toxic jewel
#

i would love to know what esoteric is to you

floral meteor
#

what it does is esoteric

dire inlet
#

rust

#

true

#

very lolteeth

floral meteor
#

you want me to make a rust syntax rip-off in python?

dire inlet
#

yes

floral meteor
#

show me some rust code

toxic jewel
#

ok

floral meteor
#

a brainfuck interpreter in rust

dire inlet
sick hound
#

!e py(lambda:print("\n".join(["linux term" for i in range(50)])))()

night quarryBOT
#

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

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

oops

floral meteor
#

I'm not making a whole flash player

dire inlet
#

oh you want to actually replicate lol

sick hound
#

!e py (lambda:print("\n".join(["linux term" for i in range(50)])))()

night quarryBOT
#

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

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

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

dire inlet
#

here ig?

#

just searched on github

floral meteor
#

I'm not gonna make the entire rust interpreter either

dire inlet
#

no lol

#

brainfuck in rust

sick hound
#

this is not python 😡

toxic jewel
dire inlet
#

get your golang out of here

sick hound
#

that's not golang

#

lol

dire inlet
#

what is it

sick hound
#

idk

dire inlet
#

oh yeah I notice the !

#

rust

#

it's rust

sick hound
#

o

#

I've never used rust

floral meteor
#

you can't really do

f a b{whatever;}

in python :/

sick hound
#

if only yoct was here and javascript was allowed

toxic jewel
#

just do println!

dire inlet
#

I was just making a joke on how rust keywords are unreadable

toxic jewel
#

i wanna see how tou use ! in python variables

sick hound
#

what does ! do

#

like not?

dire inlet
#

not operator

sick hound
#

if not t

#

lol

#
t() if not a```
floral meteor
#

use std::io::{self, prelude::*};
unfortunately, this will raise a SyntaxError, and no code can run precompiled

floral meteor
sick hound
#

!e print("a") if not False

night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     print("a") if not False
003 |                            ^
004 | SyntaxError: invalid syntax
dire inlet
#

stupid

sick hound
#

thought you could do that

floral meteor
#

told you

toxic jewel
#

!e

print("a") if not False else ...
night quarryBOT
#

@toxic jewel :white_check_mark: Your eval job has completed with return code 0.

a
toxic jewel
#

smh

floral meteor
#

also -> will raise syntax error in python so i'd have to find a rip-off of that syntax

sick hound
#

lambda

#

is like the same thing

dire inlet
#

what mikelime

toxic jewel
#

what

dire inlet
#

that is not true lol

#

that is not what the arrow operator does

sick hound
#

do you mean the -> from java lambda expressions?

#

oh the php one

toxic jewel
#

what

dire inlet
#

it's to access members of a class

toxic jewel
#

this is python

#

have you ever seen def a(v: type) -> type:

sick hound
#

no

floral meteor
#

!e ```py
a = True
(a and(lambda e:e())or(lambda*e:None))(lambda:print(420))

dire inlet
#

I don't use python much lol

night quarryBOT
#

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

420
sick hound
#

69

toxic jewel
#

!e

@lambda c:globals()['v'](104, 105)
@lambda c:globals().__setitem__('v', lambda *v:print(''.join(chr(c) for c in v)))
class   c:pass

@floral meteor are you proud dad

night quarryBOT
#

@toxic jewel :white_check_mark: Your eval job has completed with return code 0.

hi
toxic jewel
#

just ignore that

floral meteor
# sick hound 69

!e ```py
def split(a):
return a.divmod(10)
def left_bias(t):
return t[0]*10,t[1]-2
def rejoin(t):
return int.mul(*t)

@print
@rejoin
@left_bias
@split
@int
@lambda c:c()
class n:int=lambda _:69

night quarryBOT
#

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

420
floral meteor
#

YOU WANTED 69 420 YOU GOT 69 420

sick hound
#

bruuu

toxic jewel
#

!e

@print
@print()
class c:...
night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | 
002 | Traceback (most recent call last):
003 |   File "<string>", line 3, in <module>
004 | TypeError: 'NoneType' object is not callable
toxic jewel
#

sadge

sick hound
#

someone I know does stuff like this in javascript

toxic jewel
#

we aren't doing javascript

sick hound
#

I know

toxic jewel
#

j*vascript

sick hound
floral meteor
#

question mark symbol straight up does not exist in pytho

sick hound
#

no ternary operator 😭

dire inlet
#

python can't compete

alpine flower
thorn heart
#

JS is banned in here 😭

viscid nymph
#

I mean...python is in the name

thorn heart
#

That won't stop me from weeping 😭

floral meteor
#
@lambda c:c()
class use:
  def __getattr__(s,package):
    r=globals()[package]=__import__(package)
    return r
@lambda c:use.sys.modules.__setitem__('std',c())
class std:
  class io:
    __eq__=lambda s,a:return[getattr(s,e) for e in a]
    def self(s,n):
      c=__import__('sys')._getframe(n+1).f_code
      f=lambda:None
      f.__code__=c
      return f
    def prelude(s,*a):pass # TODO: prelude
  class env:pass #TODO: env
  class fs:
   def __eq__(s,name):
    globals()[name]=getattr(s,name)()
    return globals()[name]
   @lambda c:c()
   class File:... # TODO: File module
  def __eq__(self, name):
    globals()[name]=getattr(self,name)()
    return globals()[name]
@lambda c:use.sys.modules.__setitem__('brainfuck',c())
class bf:pass # TODO: brainfuck.js
@lambda c:c()
class fn:
  def __getattr__(s,n):
   def outer(*a,**k):
    def wrapper(f):
     def inner(*args,**kwargs):
      if len(args)>len(a) or len(k|kwargs)>len(k|{e:None for e in a}):
       raise Exception("Args do not match")
      k|=kwargs
      return f(*args,**k)
     return inner
    return wrapper
   outer.__name__=n
   globals[n]=outer
   return outer

hang on gotta take a breather

sick hound
floral meteor
#
use.std==io=={"self","prelude::*"};
use.std.env;
use.std.fs.File;
bf = use.brainfuck;

@fn.read_file("filename")
def read_file(filename: str) -> (Result<String, io==Error,):
  let.mut.contents = String==new();
  with File==open(filename) as _:
    _.read_to_string(mut.contents);
  return Ok(contents);

@fn.main()
def main():
  let.args = env==args().collect();
  let.filename = match.args.get(1)=={Some:lambda s:Some(s), None:lambda s:panic!=("missing filename")};
  let.contents = read_file(filename).expect("Error reading file");
  let.token = bf==tokenize(contents.chars().collect());
  let.expressions = bf==parse(tokens).expect("Error compiling program");
  let.expressions = bf==optimize(expressions);
  bf==run(expressions).expect("Error running program");

is the best i can do

toxic jewel
snow beacon
#

In my experience, it's like running freely through a forest, until the trees end and you fall into a ravine.

rugged sparrow
#

@snow beacon can i contribute to the wiki?

snow beacon
#

I can credit you if you want.

#

I'm not sure if GitHub lets you do pull requests for wiki pages, so if anyone makes something, ping me.

floral meteor
#

have you done much more than the whitespace page yet?

sick hound
#

what does @ do in py

rugged sparrow
#

ill prob add some ctypes/internal structure stuff tomorrow

#

!t decorators

night quarryBOT
#

Decorators

A decorator is a function that modifies another function.

Consider the following example of a timer decorator:

>>> import time
>>> def timer(f):
...     def inner(*args, **kwargs):
...         start = time.time()
...         result = f(*args, **kwargs)
...         print('Time elapsed:', time.time() - start)
...         return result
...     return inner
...
>>> @timer
... def slow(delay=1):
...     time.sleep(delay)
...     return 'Finished!'
...
>>> print(slow())
Time elapsed: 1.0011568069458008
Finished!
>>> print(slow(3))
Time elapsed: 3.000307321548462
Finished!

More information:
Corey Schafer's video on decorators
Real python article

rugged sparrow
#

@sick hound ^

sick hound
#

ah

#

ty

floral meteor
#

it can also call __matmul__ methods of an object

#

!e print(*dir(int()))

night quarryBOT
#

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

__abs__ __add__ __and__ __bool__ __ceil__ __class__ __delattr__ __dir__ __divmod__ __doc__ __eq__ __float__ __floor__ __floordiv__ __format__ __ge__ __getattribute__ __getnewargs__ __gt__ __hash__ __index__ __init__ __init_subclass__ __int__ __invert__ __le__ __lshift__ __lt__ __mod__ __mul__ __ne__ __neg__ __new__ __or__ __pos__ __pow__ __radd__ __rand__ __rdivmod__ __reduce__ __reduce_ex__ __repr__ __rfloordiv__ __rlshift__ __rmod__ __rmul__ __ror__ __round__ __rpow__ __rrshift__ __rshift__ __rsub__ __rtruediv__ __rxor__ __setattr__ __sizeof__ __str__ __sub__ __subclasshook__ __truediv__ __trunc__ __xor__ as_integer_ratio bit_length conjugate denominator from_bytes imag numerator real to_bytes
manic rune
#

hmmm

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

can someone explain

#

how this prints "Hello World!"

sick hound
#

yeah uh

#

so _ does a function

#

and __ does a thing

#

yk

manic rune
#

ah yes thanks for detailed explanation

sick hound
#

np

floral meteor
#

aight ```py
(
lambda _: _,
lambda _, __: _,
lambda _, __, ___: _,
lambda _, __, ___, ____: _,
lambda _, __, ___, ____, _____: _,
lambda _, __, ___, ____, _____, ______: _,
lambda _, __, ___, ____, _____, ______, _______: _,
lambda _, __, ___, ____, _____, ______, _______, ________: _
)

is a tuple of lambdas, `lambda _: _.__code__.co_argcount` converts one of the above into an integer, 1-8 
`[__(___[(lambda: _).__code__.co_nlocals])]` is `[__(___[1])]`
#

and so on

#

it's just obfuscated, that's all

#

and the rest calls a secret brainfuck interpreter built into python

snow beacon
#

Oh, I've been preempted.

#

Because ! is not a valid Python operator.

#

You might be thinking of ~ or not.

floral meteor
#

python noobs...

#

no

snow beacon
#

Not really.

floral meteor
#

~ is invert

#

bitwise operator

snow beacon
#

~ is bitwise. ~0 is -1.

#

~x equivalent to -x-1.

snow beacon
#

not is an operator.

#

There is not one, unless you store your Boolean true as -1.

floral meteor
rugged sparrow
#

python doesnt have multiline lambda

floral meteor
#

lambdas unite python and BrainFuck

floral meteor
#
#[-][ challenge: rewrite this...
@lambda _:_()
class _:
 input,en_in="",True
 B=2<<2
 __eq__,__ne__=lambda s,o:s,lambda s,o:[setattr(s,'input',o),setattr(s,'en_in',True)]if o is not None else[setattr(s,'input',""),s9etattr(s,'en_in',False)]
 __bool__=lambda s:()==()
 __int__=lambda s:s.a[s.i]
 __str__=lambda s:chr(int(s))
 __repr__=lambda s:f"\n<{s.i}: {int(s)}>"
 def __init__(s):
  s.i=s.o=2>>2
  s.a=[s.i] *((2<<s.o)**s.B* 1)
 def __pos__(s):
  s.o += 1
  return s
 def __neg__(s):
  s.o -= 1
  return s
 def __add__(s,o):
  s.a[s.i] += +(s.o,setattr(s,'o',0))[0]+ 1
  s.a[s.i] %= 2**s.B
  return s
 def __sub__(s,o):
  s.o      =- +s.o+ 1
  s.a[s.i] -= (s.o,setattr(s,'o',0))[False]
  s.a[s.i] %= 2**s.B
  return s
 def __getattr__(s,a):
  try:return object.__getattr__(s,a)
  except:return print(end=str(s))or s
 def __getitem__(s,f):
  if type(f)==type(lambda:None):
   while int(s):f()
  elif f is s:
   if s.o:s.a[s.i]=s.o=0
   elif int(s):raise RecursionError
  elif type(f)is tuple:s(f)
  return s
 def __gt__(s,o):
  s.i += 1
  s.a.extend([0]* (s.i- +len(s.a)+ 1))
  return s
 def __lt__(s,o):
  if s.i:s.i -= 1
  else:s.a.insert(0,0)
  return s
 def __rshift__(s,o):
  s>o
  return s>o
 def __lshift__(s,o):
  s<o
  return s<o
 def __call__(s,*a):
  if len(a)>1:s.a[s.i]=ord(s.input and[s.input.pop(False)for i in range( +len(a)+ -True)][-True]or '\0'if s.en_in else __import__('sys').stdin.read( +len(a)+ -True)[-True])
  elif a is...:(print(s),print(s),print(s),)
  return s
# ][... but without these commented brackety things...
# but when evaluated in brainfuck, it ends in the same state it started in. ]
floral meteor
#

!e ```py
print (
(
lambda _, __:
10 * _ .mul (
__ - 2
),
)[
0
](
*(
lambda _:
_.divmod(
10
)
)(
69
)
)
)

night quarryBOT
#

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

420
floral meteor
snow beacon
#

That's an awful lot of templates.

rugged sparrow
#

they are still single expression tho (with a lot of expressions inside that single expression)

#

im gonna try to make true multiline lambdas

#

im still figuring that out lol

floral meteor
#

easy, just make your own namespaaaaaaaace

#

or even...

#

(lambda a, b, c:None).__code__ += (lambda:a+b+c).__code__

rugged sparrow
#

i think what i want would require hooking into the compiler :/

floral meteor
#

i no coffe suficient

snow beacon
#

You could probably edit FunctionType.

#

It contains the code object for a function. Bytecode, variable names etc.

floral meteor
#

!e ```py
class MLl:
def init(self, f):
self.f=f
def call(self,*a,**k):
return self.f(*a,**k)
def add_line(self, f):
self.f.code = self.f.code.replace(co_code=self.f.code.co_code + f.code.co_code)
return self
multi_line_lambda = MLl(lambda a, b, c:None)
multi_line_lambda.add_line(lambda a,b:a+b)
multi_line_lambda.add_line(lambda _, b, c:b+c)
print(multi_line_lambda(1,2,3))

night quarryBOT
#

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

None
floral meteor
#

@rugged sparrow the problem is the first line returns

rugged sparrow
#

thats not the only issue there

floral meteor
#

!e ```py
def fff(a, b, c):
print(globals()['kkk'].code.co_code)
return globals()['kkk'](b, a, c)
kkk=lambda*a:print(fff.code.co_code)or a
print(fff(2, 3, 4))

night quarryBOT
#

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

001 | b't\x00t\x01j\x02j\x03\x83\x01p\x0e|\x00S\x00'
002 | b't\x00t\x01\x83\x00d\x01\x19\x00j\x02j\x03\x83\x01\x01\x00t\x01\x83\x00d\x01\x19\x00|\x01|\x00|\x02\x83\x03S\x00'
003 | (3, 2, 4)
floral meteor
#

wait i should made them the same

#

!e ```py
def fff(*a): print(a)
f=lambda
a:print(*a)
print(fff.code.co_code, f.code.co_code)

night quarryBOT
#

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

b't\x00|\x00\x8e\x00\x01\x00d\x00S\x00' b't\x00|\x00\x8e\x00S\x00'
floral meteor
#

!e ```py
def fff(*a):return print(a)
f=lambda
a:print(*a)
print(fff.code.co_code, f.code.co_code)

night quarryBOT
#

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

b't\x00|\x00\x8e\x00S\x00' b't\x00|\x00\x8e\x00S\x00'
floral meteor
#

oh, the def additionally LOAD_CONST 0

#

unless returned from

#

dafuq you can optimise by making it return

rugged sparrow
#
b't\x00|\x00\x8e\x00S\x00'
b't\x00|\x00\x8e\x00S\x00'
``` those are identical
floral meteor
#

ye but the one above that i didn't return from the function

#

!e ```py
def ():pass
print(
.code.co_code)

night quarryBOT
#

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

b'd\x00S\x00'
floral meteor
#

so what does S\00 do?

#

it's at the end of every code

rugged sparrow
#

d\x00 is LOAD_CONST 0

#

S\x00 is RETURN_VALUE 0

floral meteor
#

ah so that loads and returns None

rugged sparrow
#

the arg for RETURN_VALUE is unused

floral meteor
#

so what if we hacked that to "add" a function?

rugged sparrow
#

you could but youd need to add some other stuff to the code objects

floral meteor
#

test if it loads and returns None, and if so, wipe the S\00 of the first function and concatenate the code

rugged sparrow
#

and make sure the constants are in the same order

floral meteor
#

hm

#

!e ```py
class MLl:
def init(self, f):
self.f=f
def call(self,*a,**k):
return self.f(*a,**k)
def add_line(self, f):
self.f.code = self.f.code.replace(co_code=self.f.code.co_code.replace(b'S\0',b'') + f.code.co_code)
return self
multi_line_lambda = MLl(lambda a, b, c:print ("lol"))
multi_line_lambda.add_line(lambda e, f, g:e+f+g)
print(multi_line_lambda(1,2,3))

night quarryBOT
#

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

001 | lol
002 | 6
rugged sparrow
#

i mean that works

floral meteor
#

@rugged sparrow I DID IT

#

XD

#

probably the worst way possible lol

rugged sparrow
#

it works tho

floral meteor
#

except, problem is the next line cannot reference the result of the previous line

#

without hacking the code a bit more directly

#

hmm

#

how do i join their locals?

rugged sparrow
#

that is much trickier

floral meteor
#

okay, how do i make the first line add something to some stack that could then be accessed by a later line?

rugged sparrow
#

it would be easier to do this with globals hooking and wrapping the functions

floral meteor
#
class MLl:
  def __init__(self, f):
    self.f=f
  def __call__(self,*a,**k):
    return self.f(*a,**k)
  __bool__ = lambda s:True
  def add_line(self, f):
    self.f.__code__ = self.f.__code__.replace(co_code=self.f.__code__.co_code.replace(b'S\0',b'') + f.__code__.co_code)
    return self
  def add_if(self,cond,f,g):
    return cond and self.add_line(f) or self.add_line(g)
  def add_while(self, f, cf):
    def inner(*a,**k):
      while cf():
        f(*a,**k)
    return self.add_line(inner)
  def add_for(a, f):
    def inner(*a,**k):
      for i in a:
        f(i,*a,**k
    return self.add_line(inner)
  def add_try(f, E, g):
    def inner(*a,**k):
      try:return f(None,*a,**k)
      except E as e:return f(e,*a,**k)
    return self.add_line(inner)
floral meteor
#

alright how do i try except from a lambda?

rugged sparrow
#

you abuse context managers

#

contextlib.ContextDecorator

acoustic gust
snow beacon
#

It's a literal, kind of like how None is a NoneType literal.

#

You can define a function whose body is foo(), 0 or None, or indeed ....

#

I prefer to use it infinite loops:

while ...:
    print("y")
sudden osprey
#

Why is type(...) ellipsis, but when you do type(...)(1) you get the error TypeError: EllipsisType takes no arguments, i.e. why EllipsisType and ellipsis, whereas type(None) is NoneType and that is consistent with the error

naive roost
#

!e ```py
print(type(...))
print(type(None))

night quarryBOT
#

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

001 | <class 'ellipsis'>
002 | <class 'NoneType'>
limber orchid
#

How would I tackle making this smaller?

#
class Solution:
    def singleNumber(self, n: List[int]) -> int:
        return [k for k,v in __import__('collections').Counter(n).items() if v==1][0]```
#

should I try to prevent using a counter?

stark fable
#
class Solution:singleNumber=lambda n:[x for x in n if n.count(x)<2][0]```
limber orchid
#

nice lol

#

Runtime goes to shit though

#

any way of keeping it O(n) you think?

naive roost
#

in space or time complexity?

limber orchid
#

time complexity, my bad

#

Getting the space complexity down is going to be hard on one line

sudden osprey
#

import collections;collections.Counter(nums).most_common()[-1][0] works I think?

limber orchid
#

Isnt _import_ prefered over that?

sudden osprey
#

oh ye not sure why I forgot about that

limber orchid
#
class Solution:singleNumber=lambda s,n:__import__('collections').Counter(n).most_common()[-1][0]

``` works
#

thanks.

snow beacon
#
from collections import*;Counter(nums).most_common()[-1][0]
__import__("collections").Counter(nums).most_common()[-1][0]
snow beacon
#

It's a bit more of an information dump than the one before, but time is esoteric.

limber orchid
#

Nice, thanks for the resource

toxic jewel
#

excited to see when lambda is released

rugged sparrow
#

@snow beacon i dont think we can make pull requests, would you mind if i PM you stuff i write for it?

sudden willow
#

!e

a='b'

@lambda c: print(a)
@lambda c: globals().__setitem__('a', 'c')
class v:...
night quarryBOT
#

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

c
sudden willow
#

if only python didnt check for syntaxerror beforehand

#

;^(

#

wait i wonder

night quarryBOT
#

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

i love femboys x3
sudden willow
#

x3

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 |   File "<string>", line 1, in <lambda>
004 | TypeError: 'owo' object is not callable
sudden willow
#

well i tried

#

¯_(ツ)_/¯

floral meteor
#

If so, how would i be able to?

snow beacon
#

I didn't have any ideas for more content in the Truthiness and Falsiness section, I was just going to tidy it and add some dry wit.

#

The plan for other sections is in the sidebar — you could work on one of them or a different topic.

floral meteor
#

!e ```py
@lambda c:globals()['cout']<<"[REDACTED]"
@lambda c:globals().update({'cout':c()})
class v:lshift=print

snow beacon
#

Who is?

floral meteor
#

whoever keeps trying to make code that says that

snow beacon
#

Not a nice thing to say either way.

floral meteor
#

good point

#

there that better?

snow beacon
#

It's suitably meaningless.

floral meteor
snow beacon
#

I wrote the two pages there in markdown, but you could just do a brainstorm. That way I could hoover it up and fit it all together nicely when I have time.

#

I think there's a button for editing pages, which should fork the entire wiki to your account. Then you can inspect the pages' source, if that's what you mean.

floral meteor
#

yaeh

snow beacon
#

A warning to all: I do intend to make this a curated thing, rather than putting everything in unedited.

floral meteor
#

no problemo

snow beacon
#

Another warning to all: I intend to license this under something pretty permissive. Probably Unlicense or Creative Commons with Attribution.

floral meteor
#

there's a 0.23% chance i'll accidentally write a SCP article.

snow beacon
#

If you were to, that's the sort of thing I would edit heavily before including.

floral meteor
#

ALRIGHT CAPS LOCK IS GOING BACK ON IM GONNA WRITE MORE BATCH

floral meteor
snow beacon
#

Unrecognisably.

floral meteor
#

THE CHANCE OF ME WRITING AN SCP ARTICLE JUST INCREASED TO 23.72%

#

ALSO I MIGHT ACCIDENTALLY LEAVE CAPS LOCK ON

rugged sparrow
#

@snow beacon what do you want me to write about?

floral meteor
#

ALSO SHOULD WE ADD SECTIONS?

snow beacon
snow beacon
floral meteor
snow beacon
#

That's all of Esoteric Python.

#

Perhaps "Internals" would be more descriptive.

rugged sparrow
snow beacon
#

Our target audience should be an intermediate Python programmer. They might know concepts no more advanced than list comprehensions, unless they're covered by other pages.

#

The fun stuff with ctypes is monkey-patching, so that would be a good priority.

rugged sparrow
#

i can just talk about fishhook and how it works

snow beacon
#

That would be great.

floral meteor
#

OR hOw tO MakE A DecENt rIP-ofF OF fIShHook ON thEIR oWN

snow beacon
#

My poor weary ears...

floral meteor
#

EARS?

snow beacon
#

Your volume.

floral meteor
#

WHAT VOLUME?

near umbra
#

The volume of the text, duh

floral meteor
#

TEXT DOES NOT HAVE VOLUME, IT IS TWO DIMENSIONAL

near umbra
#

but are you sure about that

floral meteor
#

IT AT LEAST IS A REPERESENTATION OF A TWO-DIMENSIONAL COMMUNICATION METHOD

near umbra
#

but what if you could hear it

floral meteor
#

IT MAKES NO NOISE, IT IS A SILENT FORM OF COMMUNICATION DESIGNED TO ENTER A HUMAN BRAIN VIA VISUAL INPUT METHODS, AND EXIT A HUMAN BRAIN VIA APPENDAGES.
THE EARS, MOUTH, OR ANY AUDIO ORGANS ARE NOT INVOLVED IN THIS PROCESS IN ANY WAY.

near umbra
#

Then you must feel the text

#

Become one with the text

floral meteor
#

THE NERVOUS SYSTEM AT ITS EXTREMES IS INCAPABLE OF DISCERNING TEXT UNLESS IT IS DESIGNED FOR VISUAL DISABILITY.

near umbra
#

you must feel the text around you

floral meteor
#

IT FEELS FLAT

snow beacon
#

Yours feels deafening.

thorn heart
#

Your text is killing my imagination

terse mortar
#

Wtf is happening here lol

night quarryBOT
#

Hey @floral meteor!

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

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

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

https://paste.pythondiscord.com

floral meteor
#

dahecc

rugged sparrow
#

@floral meteor i just pushed an update to fishhook that should make it fully version independent

floral meteor
#

noice

#

!e ```py
def INSTALL_BATTERIES(C):
if len(C.doc)>72:
S=C.doc+'';C.doc=''
for I,E in enumerate(S):
if I>30 and I%30>=19:C.doc+="Low Battery"[(I%30)-19]
else:C.doc+=E
C.doc+="Power Off"
C.charge=100
return C
@INSTALL_BATTERIES
class BLUETOOTH_HEADPHONES:
"""You will hear voice guidance in the following situations via the headset.

When powering on: “Power on”
When powering off: “Power off”
When entering pairing mode: “Bluetooth pairing”
When establishing a Bluetooth connection: “Bluetooth connected”
When disconnecting a Bluetooth connection: “Bluetooth disconnected”
When checking the remaining battery charge: “Battery about XX %” (The “XX” value indicates the approximate remaining charge. Use it as a rough estimate.) / “Battery fully charged”
When the remaining battery charge is low: “Low battery, please recharge headset”
When automatically turning off due to low battery: “Please recharge headset. Power off”
"""
charge,MANUFACTURER=0,"SONY"
def init(self):self.connected, self.low_battery, self.volume = [], False, 80
def connect(self, device):self.connected+=[device];return self
def disconnect(self,i):return self.connected.pop(i)
def close(self):return exit(print ("Power off"))
def next(self,i=None,__rev=1<0):
if i is not None:return self.connected[i].getattr('prev'__rev or 'next')()
for d in self.connected[::-1]:
try:assert d.is_playing();return d.getattr('prev'
__rev or 'next')()
except:0
return 1
prev=lambda s,i:s.next(i,1>0)
def volume(self,n,here=1>0):
if here:self.volume+=n
else:self.volume=n
if self.volume>100:self.volume=100
def use_battery(self):
self.charge-=1
if 1<self.charge<10:print("Low Battery")
elif self.charge<=1:self.close()
def play(self):
for device in self.connected[::-1]:
try:ec=device.resume();assert ec;return ec
except:0
return 1
pause=lambda self:(*[d.pause()for d in self.connected[::-1]if d.is_playing()],)
print (BLUETOOTH_HEADPHONES.doc)

night quarryBOT
#

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

001 | You will hear voice guidance in the following sitLow Battery the headset.
002 | 
003 | WhenLow Batteryn: “Power on”
004 | When Low Batteryf: “Power off”
005 | WhenLow Batteryairing mode: “BluetLow Batteryg”
006 | When establishinLow Batteryth connection: “BluLow Batteryected”
007 | When disconnLow Batteryuetooth connection:Low Battery disconnected”
008 | WhenLow Batteryhe remaining batterLow BatteryBattery about XX %”Low Batteryvalue indicates theLow Batterye remaining charge.Low Batterya rough estimate.) Low Batteryfully charged”
009 | WhenLow Batterying battery charge Low Batteryw battery, please rLow Batterydset”
010 | When automatiLow Batteryng off due to low bLow Batteryease recharge headsLow Batteryff”
011 | Power Off
floral meteor
#

There we go i finally perfected the annoyingness of bluetooth headphones!

rugged sparrow
floral meteor
#

3.10 OWO

rugged sparrow
#

as long as no new tp_as_* is added

floral meteor
#

my entire cursedutils will likely collapse in 3.10

rugged sparrow
#

even if they change size it should work

#

@simple crystal fishhook==0.0.8 should work on 3.10

simple crystal
#

I guess I cna look at git

rugged sparrow
#

now it generates the layout of structs dynamically

simple crystal
#

interesting

rugged sparrow
#

i realized that on user classes (ie the ones made in python) the structs are located within the types memory

#

this can be seen here

#

!e ```py
print(type.sizeof(type))

class A:pass

print(type.sizeof(A))```

night quarryBOT
#

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

001 | 408
002 | 1048
rugged sparrow
#

so by reading the memory of the type object i can look for pointers that are into the classes memory and use them to calculate struct size and the offset of the pointer in general

#

!e ```py
from ctypes import *
import sys
base_size = sizeof(c_ssize_t)
wrapper_type = type(int.add)

static_size = type.sizeof(type) // base_size

def mem(addr, size):
return (c_char*size).from_address(addr)

class _scratch:pass
_size = type(_scratch).sizeof(_scratch)
_start = id(_scratch)
_end = _start + _size
_cls_mem = mem(_start, _size).raw
_intermediate = []
for i in range(0, _size, base_size):
_val = int.from_bytes(_cls_mem[i:i + base_size], sys.byteorder)
if _start < _val < _end:
_intermediate.append((i//base_size, _val))
_last_addr = None
_offsets, _sizes = [0], [static_size]
for _offset, _addr in sorted(_intermediate, key=lambda i:i[1]):
if _last_addr is not None:
_sizes.append((_addr - _last_addr)//base_size)
_offsets.append(_offset)
_last_addr = _addr

_structs = tuple(zip(_sizes, _offsets))
print(_structs)

night quarryBOT
#

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

((51, 0), (3, 10), (36, 12), (3, 14), (10, 13), (7, 20))
night quarryBOT
#

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

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

nice

#

I look forward to figuring out exactly what is going on there

#

appreciate your work as always haha

rugged sparrow
#

thanks

rugged sparrow
simple crystal
#

kk 🙂

floral meteor
#

there's a way to make that no print globals without hacking any built-ins

snow beacon
#

print = lambda *_, **__:...?

floral meteor
#

that's hacking builtins

snow beacon
#

It does nothing to builtins.

#

There's that 'redirect stdout' context manager in one of the libraries.

#

You could also probably close sys.stdout.

floral meteor
#

okay I'll make the statement itself crash python

snow beacon
#

You could put an error in the __repr__ of something in the global scope.

floral meteor
#

!e ```py
@lambda c:c()
class exit:
def repr(self):
try:import('sys').setrecursionlimit(9009); repr(self)
except:repr(self)

print("testings")
print(globals())
print("no printings")

night quarryBOT
#

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

001 | testings
002 | Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
003 | Python runtime state: initialized
004 | 
005 | Current thread 0x00007faa78f0f740 (most recent call first):
006 |   File "<string>", line 4 in __repr__
007 |   File "<string>", line 5 in __repr__
008 |   File "<string>", line 5 in __repr__
009 |   File "<string>", line 5 in __repr__
010 |   File "<string>", line 5 in __repr__
011 |   File "<string>", line 5 in __repr__
... (truncated - too many lines)

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

floral meteor
#

mwahahahahaha

snow beacon
#

!e```py
class x:repr=0
x=x()
print("Printing globals:")
print(globals())

verbal geode
#
@commands.Bot(command_prefix="!", case_insensitive=True, intents=discord.Intents.all()).command()
async def command(ctx):
    await ctx.send("Test")
grave rover
rugged sparrow
#

They added a new slot to tp_as_async

#

In theory my change to fishhook should let it work regardless of if they add/remove slots

verbal geode
nimble heron
#

is there a way to get the function obj inside the function itself?
simplier to how self is used inside the class?

proper vault
#

you can get the code object using inspect, but I am not aware of any way to the function itself

late talon
late talon
nimble heron
#

oh

#

ah right, i can get the func attrs from there.. thanks

grave rover
#

I wonder if I want to just do only_on(min, max=None)(cprop(...)) or instead cprop(...).only_on(min, max=None) or something

rugged sparrow
grave rover
#

👀

rugged sparrow
#

@grave rover now im working on a way to get the wrapperbase offsets dynamically (without needing to traverse any wrapper struct)

rugged sparrow
#

@simple crystal @floral meteor ^

#

major update to fishhook, now it supports all 79 slot backed dunders (and will automatically support any new ones that are added)

simple crystal
#

nice

#

does editing __init__ or __new__ with it affect behavior of literals now?

rugged sparrow
#

depends on the literal, but most literals do not use abstract.c functions at all

#

and the slots i hook are called from there

simple crystal
#

ah

rugged sparrow
#

!e ```py
import gc

marker = object()
class magic:
def length_hint(self):
return 2
def iter(self):
yield marker
[tup] = [x for x in gc.get_referrers(marker) if type(x) is tuple]
yield tup

T = tuple(magic())
print(T)
print(T[1] is T)```

night quarryBOT
#

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

001 | (<object object at 0x7fa7a8785110>, (...))
002 | True
rugged sparrow
#

self referring tuple with no ctypes or memory corruption

rugged sparrow
#

!e ```py
import gc

class magic:
def length_hint(self):
return 1
def iter(self):
for obj in gc.get_objects():
if isinstance(obj, tuple) and len(obj) == 1:
try:1 in obj
except SystemError:
yield obj
break

T = tuple(magic())
print(T)
print(T[0] is T)```

night quarryBOT
#

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

001 | ((...),)
002 | True
rugged sparrow
#

better self referring tuple (is is possible to avoid the try/except using repr(obj) but i didnt want to rely on the fact that tuples can represent Null as <NULL>

late talon
#

what would recursion in recursion in recursion look like

viscid nymph
#

Wdym?

late talon
snow beacon
snow beacon
late talon
viscid nymph
snow beacon
nimble heron
viscid nymph
#

!e

@lambda f:f.__get__(f,type(f))
def foo(self):
    print(self is foo) # True
foo()
night quarryBOT
#

@viscid nymph :white_check_mark: Your eval job has completed with return code 0.

False
viscid nymph
#

oh

late talon
viscid nymph
#

!e

import sys
sys.setrecursionlimit(100000)

def foo():
    try: foo()
    except: foo()
foo()
night quarryBOT
#

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

[No output]
nimble heron
#

yeah.. same doubt

#

just now tried that

#

!e

def b(f):
 return lambda *args, **kwargs: f(f, *args, **kwargs)

@b
def aa(self):
    print(self is aa)
aa()
night quarryBOT
#

@nimble heron :white_check_mark: Your eval job has completed with return code 0.

False
nimble heron
#

yeee

viscid nymph
nimble heron
#

heh?

snow beacon
#

Oh, sorry, foo doesn't refer to the original function anymore.

nimble heron
#

refers to the wrapped eh

snow beacon
#

It refers to the wrapped one.

nimble heron
#

f

#

is there a way to overcome using some functools magic 🤔

viscid nymph
#
>>> type((lambda:...).__get__(1,int))
<class 'method'>

VeryCool

snow beacon
#

You could set the __code__ on the original function to the wrapped one, but you'd need to make a copy of it first.

nimble heron
#

ah, that ruins the magic of it being the original funct

snow beacon
#

It would be the original function, just with its code edited.

viscid nymph
#

!e

@lambda f: (x:=lambda *args, **kwargs: f(x, *args, **kwargs))
def foo(self):
    print(self is foo) # True
foo()
night quarryBOT
#

@viscid nymph :white_check_mark: Your eval job has completed with return code 0.

True
nimble heron
#

👀

snow beacon
#

Touché. Good spotting.

nimble heron
#

what does the walrus do here again?

viscid nymph
#

assignment operator

#

woops

#

!e

print(x:=1, x)
night quarryBOT
#

@viscid nymph :white_check_mark: Your eval job has completed with return code 0.

1 1
nimble heron
#

well yeah like if x:= somefunction

#

uh why not just = ?

viscid nymph
#

!e

print(x=1, x)
night quarryBOT
#

@viscid nymph :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(x=1, x)
003 |                 ^
004 | SyntaxError: positional argument follows keyword argument
nimble heron
#

oh

#

assign and return

viscid nymph
#

Yep. You can't use = in expressions.

nimble heron
#

neato! ty

#

how would i do it in 3.8 now kek?

viscid nymph
#

It came in 3.8.

nimble heron
#

well i cant do it in 3.8

#

3.8 only supported conditionals with walrus

viscid nymph
#

Ah it's because python < 3.9 is strict for decorators

nimble heron
#

oh f

#

maybe functools.partial 🤔

viscid nymph
#
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> @lambda f: f
  File "<stdin>", line 1
    @lambda f: f
     ^
SyntaxError: invalid syntax
#

partial partial lol

nimble heron
#

yikies

#

!e

from functools import partial

def b(f):
 x = lambda *args, **kwargs: partial(f(*args, **kwargs),x)
 return x
@b
def aa(*args, **kwargs):
    print(x is aa)
aa()
night quarryBOT
#

@nimble heron :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 9, in <module>
003 |   File "<string>", line 4, in <lambda>
004 |   File "<string>", line 8, in aa
005 | NameError: name 'x' is not defined
nimble heron
#

nop i got no clue

viscid nymph
#
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from functools import partial
>>> @partial(lambda f: (x:=lambda *args, **kwargs: f(x, *args, **kwargs))) 
... def foo(self):
...     print(self is foo) 
... 
>>> foo()
True
nimble heron
#

OH!

#

neat

viscid nymph
#

can't do it one line though

nimble heron
#

-> that deco is one-line

#

ty, u are awesome

viscid nymph
#
>>> @getattr('','', lambda f: (x:=lambda *args, **kwargs: f(x, *args, **kwargs))) 
... def foo(self):   
...     print(self is foo) 
... 
>>> foo()
True

this is an interesting way of doing it

nimble heron
#

🤔 .. getattr what

#

wait how does that work

viscid nymph
#

just need a function that returns the lambda

snow beacon
#

It tries to get ''., which is the empty string attribute of the empty string, and if it fails (it does) returns the lambda.

nimble heron
#

ahhh

#

so fallback

#

i see, wew clever!

snow beacon
#

Unrelated interesting thing:```py
from builtins import bytearray as bytes

viscid nymph
#

that is weird

#

bytes = bytearray

snow beacon
#

I used this sort of thing in a contest recently.

#

The code defined a function that only threw errors, but used a host of decorators to make it solve the goal of the contest.

floral meteor
#

I feel like they're Easter eggs

rugged sparrow
#

@floral meteor you can do from fishhook import generate_slotmap and then print(generate_slotmap().keys())

#

*that only works on then newest version

#

these are only the ones backed by slot pointers

#

there may be other ones (there are)

floral meteor
#

Also is pypi upgrading as tedious as uploading?

rugged sparrow
#

not really?

#

if you have it setup well

floral meteor
#

So I just press the setup button then twine uploady stuff?

rugged sparrow
#

yea

floral meteor
#

Well my pc isn't currently connected to internet so I can't hack it from here I might even have to take it out my backpack and do it manually

snow beacon
#

That sounds arduous. You could always leave pypi unupdated if that's easier.

floral meteor
#

Try pip install cursedutils==4.2.0
And tell me that could be let unupdated

snow beacon
#

Do you use semantic versioning?

floral meteor
#

It's fucking cursed, I accidentally bound half of it to the module itself and one of the functions blue screens but only on windows

snow beacon
#

Linux doesn't tend to bluescreen, to be fair.

floral meteor
#

Linux runs it fine but terminates it after it sucks about 10gb of ram

#

Ahem

#

Semitic versioning?

#

Do I have to?

#

Atm I use cursed versioning, which starts at 4.2.0 and does cursed things

snow beacon
# floral meteor Semitic versioning?

The manifesto is enlightening. It's good to understand, not because it is always the best solution, but because it is always a very good solution. (Unlike some other manifestos.)

#

And you misspelt it.

floral meteor
#

Deliberately. See fuckitpy for where I plagiarized that idea from

snow beacon
#

It's probably pointless to get into whether or not 4.2.0 is 'Semitic' or not.

floral meteor
#

Probably shoulda started at 0

#

.0

#

.1

#

If I push that version will it be considered later or earlier update?

snow beacon
#

Do you mean 0.0.0?

#

That would be an earlier version, I believe.

floral meteor
#

Aww

#

What about 4.2.0.1 ?

#

Would that even work?

snow beacon
#

It would not.

#

People don't use accurséd versioning because even cursed modules need to update.

floral meteor
#

4.2.1

#

I legit woulda kept appending .1

snow beacon
#

I don't doubt it.

floral meteor
#

Probably woulda got to 4.2.0.1.1.1.1.1.1 before noticing something was wrong

#

4.2.1 will likely be just as bad, but worse, but more accurate

floral meteor
#

Esoteric Python and metacoding are essentially the same right?

earnest wing
#

Metaprogramming is usually pretty not-esoteric. It can be taken off the deep end, though.

floral meteor
#

hm.
What about programming where the appearance of the code is part of the goal?
What is that called?

snow beacon
#

Do you mean whitespace versus code, making shapes and all of that? I'm going to steal a term from another field and call it 'concrete' coding.

floral meteor
#

why concrete tho?

snow beacon
#

It's from another field.

#

I don't know of any programming word for it.

floral meteor
#

huh. ASCII art with code is esoteric?

snow beacon
#

I would think so.

floral meteor
#

are there any good examples in Python?

floral meteor
#

canary?

snow beacon
#

Canary.

floral meteor
#

!e ```py
(lambda ,,,:getattr(getattr(import(True.class.doc[(**)]+True.doc[(*)**+*]+True.class.doc[*(True+)]),import(True.doc[True-]+True.class.doc[(***+)*]+True.doc[(+)__+True]).doc[int(chr(+(*)+)+chr(+(**)+)+chr(+(_*))):int(chr(+(___)+)+chr(+(___)+*)+chr(+(**)))+]),getattr(import(chr((_)**+*)+True.doc[(***+)*]+True.class.doc[True-]),import(chr((*+)*)+True.class.doc[(__*)+*]+True.doc[(+__)*+True]).doc[int(chr(+(**)+)+chr(+(___)+*)+chr(+(**))):int(chr(+(**)+)+chr(+(___)+*)+chr(+(**)))+__]).doc[int(True.int().str()+str(True)+False.int().str()+str(__)):int(True.int().str()+str(True)+False.int().str()+str())+]+getattr(import(chr((__)**+*)+True.doc[int(True.int().str()+True.int().str()+str())]+chr((*)+*)),import(chr(int(True.int().str()+True.int().str()+str()))+True.doc[int(True.int().str()+True.int().str()+str())]+True.class.doc[*(-True)]).doc[int(chr(+(**)+)+chr(+(___)+*)+chr(+(**))):int(chr(+(**)+)+chr(+(___)+*)+chr(+(**)))+]).doc[((-)+*)*____:(-**__)]+True.class.doc[**])(True.doc[**-True].upper()+True.class.doc[**-]+True.class.doc[]+True.doc[True]+True.class.doc[^]+chr((**+**_)*+^)+chr(****+*+True)+chr((*(*)*)+**+*)+True.doc[]+chr((*)**)+True.class.doc[*__]))(True<<True,(True<<True)+True,(True<<True<<True)+True,True.class.doc.find(chr(False)))

night quarryBOT
#

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

Hello World
floral meteor
#

@snow beacon so what would this be classed as, it evaluates the same in both python and brainfuck:

#[-][
@lambda _:_()
class _:
 input,en_in="",True
 B=2<<2
 __eq__,__ne__=lambda s,o:s,lambda s,o:[setattr(s,'input',o),setattr(s,'en_in',True)]if o is not None else[setattr(s,'input',""),s9etattr(s,'en_in',False)]
 __bool__=lambda s:()==()
 __int__=lambda s:s.a[s.i]
 __str__=lambda s:chr(int(s))
 __repr__=lambda s:f"\n<{s.i}: {int(s)}>"
 def __init__(s):
  s.i=s.o=2>>2
  s.a=[s.i] *((2<<s.o)**s.B* 1)
 def __pos__(s):
  s.o += 1
  return s
 def __neg__(s):
  s.o -= 1
  return s
 def __add__(s,o):
  s.a[s.i] += +(s.o,setattr(s,'o',0))[0]+ 1
  s.a[s.i] %= 2**s.B
  return s
 def __sub__(s,o):
  s.o      =- +s.o+ 1
  s.a[s.i] -= (s.o,setattr(s,'o',0))[False]
  s.a[s.i] %= 2**s.B
  return s
 def __getattr__(s,a):
  try:return object.__getattr__(s,a)
  except:return print(end=str(s))or s
 def __getitem__(s,f):
  if type(f)==type(lambda:None):
   while int(s):f()
  elif f is s:
   if s.o:s.a[s.i]=s.o=0
   elif int(s):raise RecursionError
  elif type(f)is tuple:s(f)
  return s
 def __gt__(s,o):
  s.i += 1
  s.a.extend([0]* (s.i- +len(s.a)+ 1))
  return s
 def __lt__(s,o):
  if s.i:s.i -= 1
  else:s.a.insert(0,0)
  return s
 def __rshift__(s,o):
  s>o
  return s>o
 def __lshift__(s,o):
  s<o
  return s<o
 def __call__(s,*a):
  if len(a)>1:s.a[s.i]=ord(s.input and[s.input.pop(False)for i in range( +len(a)+ -True)][-True]or '\0'if s.en_in else __import__('sys').stdin.read( +len(a)+ -True)[-True])
  elif a is...:(print(s),print(s),print(s),)
  return s
#] I think I covered all the bases
if __name__=='__main__':
 _++++++++++_ and[
  lambda:(((((_>_)++++++++++_)>_)+++++++++++_>_)+++_<<_<_)-_
 ]>(_>>_)++_<<_
 (_++++_)._---_
 _._>_
 (_--_)._._
 (_+++_)._>_
 (_._<_)++++++++_
 (_._--------_)._+++_
 (_._<_)+++++++_
 _._--------_
 (_._>>_)+_
 _._
snow beacon
#

It's a polyglot.

floral meteor
#

ployglot!

snow beacon
#

Not quite.

#

A polyglot.

floral meteor
#

note the misleading syntax

floral meteor
#

This just happened without my usual hackery. :/

floral meteor
#

What if a piece of code is simultaneously polyglot, obfuscated, code art and golfed?

snow beacon
#

Hopefully it does something interesting.

floral meteor
#

It'll probably just print hello world, although there's a chance it will instead scrape a cat adoption website and return the details of the fattest cat.

earnest wing
#

Obfuscated golfed code art often is one and the same.

simple crystal
#

u can't golf poly glot o.O

snow beacon
#

Don't tempt them.

simple crystal
#

!e

print(__doc__)
night quarryBOT
#

@simple crystal :white_check_mark: Your eval job has completed with return code 0.

None
simple crystal
#

!e

"""eyy ima doc eyy"""
print(__doc__)
night quarryBOT
#

@simple crystal :white_check_mark: Your eval job has completed with return code 0.

eyy ima doc eyy
simple crystal
#

!e

exec("""
'eyy ima doc eyy'
print(__doc__)""")
night quarryBOT
#

@simple crystal :white_check_mark: Your eval job has completed with return code 0.

eyy ima doc eyy
simple crystal
#

!e

'eyy im a doc tho'
exec("""
'eyy ima doc eyy'
print(__doc__)""")
night quarryBOT
#

@simple crystal :white_check_mark: Your eval job has completed with return code 0.

eyy ima doc eyy
night quarryBOT
#

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

001 | bruv
002 | True
003 | Traceback (most recent call last):
004 |   File "<string>", line 2, in <module>
005 | TypeError: eval() arg 1 must be a string, bytes or code object
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: eval() arg 1 must be a string, bytes or code object
sick hound
#

Use map

#

map(eval, b)

night quarryBOT
#

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

001 | bruv
002 | True
#

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

001 | bruv
002 | True
003 | (None, 8, None)
#

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

001 | lol
002 | Ok
#

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

001 | No
002 | Bruh
cosmic path
rustic aspen
#

wait hold on i know that im 9 days late but are we just going to ignore that font?

hard spoke
#

You sweet summer child 😛

rustic aspen
#

OH FUCK YOU

hard spoke
#

it's all Unicode

rustic aspen
#

you did not

#

the moment i said it

#

i realized what you could've done

#

how can i make space equal to something?

strange basin
#

!e

ₚ𝔯𝕚ₙ𝓉(𝔟𝕪ₜᵉ𝓈(m𝔞ₚ(lambda _:ⅈₙᵗ(76+_*(0xfor _ in'?')/3),(-.8,-1.4,0,0,.6,-8.8,-1.4,1.4,.6,1.6,-1.4,1.3,-.6,-1.8,-8.8,2.2,.6,1.3,0,-1.6,-8.6))))
night quarryBOT
#

@strange basin :white_check_mark: Your eval job has completed with return code 0.

b'HELLO ESOTERIC WORLD!'
strange basin
#

!e

# Wait what?
print('Is anything truthy in an empty array?', any([]))
print('Is everything truthy in an empty array?', all([]))
night quarryBOT
#

@strange basin :white_check_mark: Your eval job has completed with return code 0.

001 | Is anything truthy in an empty array? False
002 | Is everything truthy in an empty array? True
near umbra
#

lol

night quarryBOT
#
any

any(iterable)```
Return `True` if any element of the *iterable* is true. If the iterable is empty, return `False`. Equivalent to:

```py
def any(iterable):
    for element in iterable:
        if element:
            return True
    return False
viscid nymph
#

!d all

night quarryBOT
#
all

all(iterable)```
Return `True` if all elements of the *iterable* are true (or if the iterable is empty). Equivalent to:

```py
def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True
strange basin
#

Yes, I know, but it feels wrong to say that all items are True in a collection and at the same time say that all items are False in that same collection.

near umbra
#

yeah seems odd

strange basin
#

!e

print(0xfor x in range(10))
night quarryBOT
#

@strange basin :white_check_mark: Your eval job has completed with return code 0.

15
strange basin
#

!e

for x in ['0' + i * '**0' for i in range(10)]:
    print(eval(x), '=', ~len(x) % 2, '=', x)
night quarryBOT
#

@strange basin :white_check_mark: Your eval job has completed with return code 0.

001 | 0 = 0 = 0
002 | 1 = 1 = 0**0
003 | 0 = 0 = 0**0**0
004 | 1 = 1 = 0**0**0**0
005 | 0 = 0 = 0**0**0**0**0
006 | 1 = 1 = 0**0**0**0**0**0
007 | 0 = 0 = 0**0**0**0**0**0**0
008 | 1 = 1 = 0**0**0**0**0**0**0**0
009 | 0 = 0 = 0**0**0**0**0**0**0**0**0
010 | 1 = 1 = 0**0**0**0**0**0**0**0**0**0
viscid nymph
proper vault
#

(0xf)or

viscid nymph
#

OOH

simple crystal
#

!e

a = eval('[[0]*6]+'*6+'[]')
a[0][0] = 2
for x in filter(print,a):
    break
night quarryBOT
#

@simple crystal :white_check_mark: Your eval job has completed with return code 0.

001 | [2, 0, 0, 0, 0, 0]
002 | [0, 0, 0, 0, 0, 0]
003 | [0, 0, 0, 0, 0, 0]
004 | [0, 0, 0, 0, 0, 0]
005 | [0, 0, 0, 0, 0, 0]
006 | [0, 0, 0, 0, 0, 0]
simple crystal
#

why does this print everything?

proper vault
#

print returns None, which is falsey, so the for loop gets an empty iterable and does nothing

simple crystal
#

ah makes sense

#

I thought if func was None it checked falsiness of list element but that must literally be if the arg to flter is None

cloud fossil
#

!e

a = eval('[[0]*6]+'*6+'[]')
a[0][0] = 2
night quarryBOT
#

@cloud fossil :warning: Your eval job has completed with return code 0.

[No output]
cloud fossil
proper vault
#

the filter calls print

simple crystal
#

the filter object applies print to every list element

#

on iteration

naive roost
#

the bot is not a REPL, it's running what you provide it as a script

cloud fossil
#

i thought it doesn't do anything until it is being exhausted or whatever

proper vault
#

the for loop does just that

simple crystal
#

that's why I used a for loop

cloud fossil
#

it exhausted all of it on the first preiteration?

#

oh.

#

well that makes sense

simple crystal
#

yeah that confused me too

#

lol

cloud fossil
#

it needs to know what is in there

#

yeah

proper vault
#

!e

a = eval('[[0]*6]+'*6+'[]')
a[0][0] = 2
for x in filter(print,a):
    raise ValueError(I_am_not_defined)
    break
night quarryBOT
#

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

001 | [2, 0, 0, 0, 0, 0]
002 | [0, 0, 0, 0, 0, 0]
003 | [0, 0, 0, 0, 0, 0]
004 | [0, 0, 0, 0, 0, 0]
005 | [0, 0, 0, 0, 0, 0]
006 | [0, 0, 0, 0, 0, 0]
rugged sparrow
#

the bot runs python3 {some flags} -i "{your code}"

cloud fossil
simple crystal
#

it never even reaches body of the for neato

cloud fossil
proper vault
#

why wouldn't it? a for loop over an empty iterable never happens

rugged sparrow
#

print returns None which is falsey, so filter cuts it out

cloud fossil
#

that's runtime for you

#

lol

#

hmmmm

proper vault
#

yeah, python is one of the few languages which don't report NameErrors ahead of time

cloud fossil
#

!e

for i in []:
  print(1/0)
night quarryBOT
#

@cloud fossil :warning: Your eval job has completed with return code 0.

[No output]
cloud fossil
#

😐

proper vault
#

!e

print(False and I_am_not_defined)
night quarryBOT
#

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

False
cloud fossil
#

i thought a falsey and returns the second expression

proper vault
#

a truthy and would do that

rugged sparrow
#

that would be or

cloud fossil
#

ahgghh

rugged sparrow
#

!e py print(False or 'a')

night quarryBOT
#

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

a
cloud fossil
#

well you are not wrong

#

but that is true

#

not false

#

!e

print(False or None)
night quarryBOT
#

@cloud fossil :white_check_mark: Your eval job has completed with return code 0.

None
proper vault
#

the right hand side never gets check for truthiness

#

it is either ignored, or returned as is

cloud fossil
#

for an and?

#

ye

proper vault
#

for both and and or

cloud fossil
#

!e

print(True or 1)
night quarryBOT
#

@cloud fossil :white_check_mark: Your eval job has completed with return code 0.

True
cloud fossil
#

lazy bastards

#

lol

#

hm

#

!e

print(True or 1/0)
night quarryBOT
#

@cloud fossil :white_check_mark: Your eval job has completed with return code 0.

True
cloud fossil
#

😬