#esoteric-python

1 messages · Page 104 of 1

thin trout
#

Hahaha

#

Optimisation smh

snow beacon
#

111-1-1<<1+1+1

grave rover
#

!e ```py
import dis
dis.dis('(((((((True << (((([]==[]) << True) + True))) - True) << (True << True))) - True) << (True << True)) + True) << ((True << True) + True)')

night quarryBOT
#

@grave rover :white_check_mark: Your eval job has completed with return code 0.

001 |   1           0 LOAD_CONST               0 (True)
002 |               2 BUILD_LIST               0
003 |               4 BUILD_LIST               0
004 |               6 COMPARE_OP               2 (==)
005 |               8 LOAD_CONST               0 (True)
006 |              10 BINARY_LSHIFT
007 |              12 LOAD_CONST               0 (True)
008 |              14 BINARY_ADD
009 |              16 BINARY_LSHIFT
010 |              18 LOAD_CONST               0 (True)
011 |              20 BINARY_SUBTRACT
... (truncated - too many lines)

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

grave rover
#

tfw it doesn't optimize []==[] and similar

dapper parrot
#

how can i customise this string

earnest wing
#

you can't do that with the stock REPL, as far as I know

#

even PYTHONSTARTUP is executed after it's output

next flame
#

cough use ipython cough

tribal moon
# dapper parrot

you can use code.InteractiveConsole to make an interactive console to make that string different for the current shell, but not everywhere

#
shell = code.InteractiveConsole()
shell.interact("Customized string here")```
next flame
#

why use vanilla repl when you can use a fancy repl with actual syntax highlighting and tab completion

tribal moon
#

I knew it

#

their question was how to change that string at the beginning of new repls

earnest wing
next flame
#

xd just keep it open the entire time

twilit grotto
#

it's amortized constant lul

frozen holly
#

So apparently python 3.10 is adding pattern matching

#

There's gonna be a rennasiance of unreadable code

dusky dagger
#

unreadable fast™️ code /s

snow beacon
#

Just seven more months...

steep mural
#

I don't think pattern match fits very well with python because 1. there aren't any labels (switch case usually uses labels but rust has entirely different syntax for it "MatchArm"... this feels a little weird in python since everything looks like a label) 2. this is the first time a block will only be valid in another 3. you can assign to _ 4. https://brennan.io/2021/02/09/so-python/ ???? 🙃

sick hound
#

!e

while G:
 A+=1
 if (I(D(A))/2).is_integer():
  E=G
  for F in range(0,I(D(A)),2):
   B=D(A)[F:F+2];C=0
   for H in D(A):
    if H==B[1]:C+=1
    if C>J(B[0]):break
   if C!=J(B[0]):E=False
  if E==G:print(A)```
night quarryBOT
#

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

001 | 10
002 | 12
003 | 13
004 | 14
005 | 15
006 | 16
007 | 17
008 | 18
009 | 19
010 | 22
011 | 1012
... (truncated - too many lines)

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

twilit grotto
#

doesn't that not work

sick hound
#

!e

for i in __import__("itertools").count(0):
  for j in (k:=str(i)[::2]):
     if k.count(j) != int(j): break
  else: print(i)
#

?

#

!e

for i in __import__("itertools").count(0):
  for l, j in enumerate((k:=str(i)[::2])):
     if k.count(j) != int(k[l+1]): break
  else: print(i)
night quarryBOT
#

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

001 | 1
002 | 10
003 | 11
004 | 12
005 | 13
006 | 14
007 | 15
008 | 16
009 | 17
010 | 18
011 | 19
... (truncated - too many lines)

Full output: too long to upload

sick hound
#

op

#

!e

for i in __import__("itertools").count(0):
  if len(str(i)) % 2 != 1: continue
  for l, j in enumerate((k:=str(i)[::2])):
     if k.count(j) != int(k[l+1]): break
  else: print(i)
#

!e

for i in __import__("itertools").count(0):
  if len(str(i)) % 2 != 0: continue
  for l, j in enumerate((k:=str(i)[::2])):
     if k.count(j) != int(str(i)[l*2+1]): break
  else: print(i)
#

er,

#

??

#

wait oh

night quarryBOT
#

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

001 | 11
002 | 21
003 | 31
004 | 41
005 | 51
006 | 61
007 | 71
008 | 81
009 | 91
010 | 1101
011 | 1121
... (truncated - too many lines)

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

sick hound
#

huh

#

gonna need to work w/ pycharm

#

!e

J=int;I=len;G=True;D=str;A=0
while G:
 A+=1
 if (I(D(A))/2).is_integer():
  E=G
  for F in range(0,I(D(A)),2):
   B=D(A)[F:F+2];C=0
   for H in D(A):
    if H==B[1]:C+=1
    if C>J(B[0]):break
   if C!=J(B[0]):E=False
  if E==G:print(A)```
#

where should i ask for help in regex?

night quarryBOT
#

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

001 | 10
002 | 12
003 | 13
004 | 14
005 | 15
006 | 16
007 | 17
008 | 18
009 | 19
010 | 22
011 | 1012
... (truncated - too many lines)

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

sick hound
#

is this the right channel?

#

this is a shity place to ask for help lol

sick hound
#

@runic ruin code doesn't seem to work

#

wait

#

no

#

i'm just small brain

#
for num in __import__("itertools").count(0):
    if len(str(num)) % 2 == 1: continue
    for i, j in enumerate(str(num)[1::2]):
        if int(str(num)[i * 2]) != str(num).count(j): break
    else: print(num)```
#

behold a 5 liner

#

@runic ruin

#

or if importy is cheaty

a = 0
while (a:=a+1):
runic ruin
#

!e py for num in __import__("itertools").count(0): if len(str(num)) % 2 == 1: continue for i, j in enumerate(str(num)[1::2]): if int(str(num)[i * 2]) != str(num).count(j): break else: print(num)

night quarryBOT
#

@runic ruin :x: Your eval job timed out or ran out of memory.

001 | 10
002 | 12
003 | 13
004 | 14
005 | 15
006 | 16
007 | 17
008 | 18
009 | 19
010 | 22
011 | 1012
... (truncated - too many lines)

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

runic ruin
#

@sick hound how the heck...

#
B=str
for A in __import__('itertools').count(0):
 if len(B(A))%2==1:continue
 for (C,D) in enumerate(B(A)[1::2]):
  if int(B(A)[C*2])!=B(A).count(D):break
 else:print(A)
sick hound
#

?

#
v = 0
while(v:=v+1):
    if len(n:=str(v))%2:continue
    for i,j in enumerate(n[1::2]):
        if int(n[i*2])!=n.count(j):break
    else:print(v)```
#

here's no importing

#
for v in __import__("itertools").count(0):
    if len(n:=str(v))%2:continue
    for i,j in enumerate(n[1::2]):
        if int(n[i*2])!=n.count(j):break
    else:print(v)```
#

this is importing

#

@runic ruin

#

sorry my internet gave out

runic ruin
#

I just shortened it a bit (removed extra spaces mostly)

#

the import one

sick hound
#

yep

runic ruin
#

but which one is faster?

sick hound
#

¯_(ツ)_/¯

#

idek how count works

#

probably the first one, as you don't have to call a generator

#

but they're really close

runic ruin
#

you could technically shorten it more by removing the if:break, but then it would be ever so slightly slower

sick hound
#

no it needs it

#

cause python's break sets a flag that I don't have to define

#

which i can read with else

runic ruin
#

*I meant on the original code

sick hound
#

?

#

yours?

runic ruin
#

yeah

#

its not needed, and wouldn't make much of a difference

sick hound
#

Which py ver?

runic ruin
#

3.7

sick hound
#

Only works on 3.8+

runic ruin
#

oh

#

what about the import one?

#

@sick hound

viscid nymph
#

walrus operator is python 3.8 +

sick hound
#

also

#

3.8+

#

cause :=

sick hound
#

well yea but you used an extra line

#

and you didn't use walrus

viscid nymph
sick hound
#

.

#

y tho

viscid nymph
#

one less line ¯_(ツ)_/¯

sick hound
#

you should try to shorten it even more

#

lmfao

runic ruin
#

I've started a war

viscid nymph
#

what's the goal here

sick hound
#

find all numbers that describe itself

#

or until you run out of memory

runic ruin
#

the largest I could find was 98989898989898989876767676767676545454545432323210

#

so we may be here a while

sick hound
#

98989898989898989876767676767676545454545433322121

#

here's a higher one

viscid nymph
#

I ran my code and it stopped at 666666

runic ruin
viscid nymph
#

I still don't understand what "numbers that describe itself" means

runic ruin
sick hound
#

aka

#

abcd

#

there are a b's

#

and c d's

#

in the num

runic ruin
sick hound
#

98989898989898989876767676767676545454545497972323

#

really?

viscid nymph
#

according to that page there should always be a zero inside the number

runic ruin
#

989898989898989898979797979797979797969696969696969696959595959595959595949494949494949494939393939393939393929292929292929292919191919191919191909090909090909090

#

Everyone happy?

sick hound
#

Wait

#

Actually

#

That thingy is different from our goal

runic ruin
#

it describes itself

sick hound
#

assuming num abcd, there are a b's in the number and c d's

runic ruin
#

nine eights (x9) nine sevens (x9) nine sixes (x9) nine fives (x9) nine fours (x9) nine threes (x9) nine twos (x9) nine ones (x9) nine zeros (x9)

sick hound
#

Aka 14233221 1 4, 2 3s, etc

viscid nymph
#

so not 4 2s?

runic ruin
sick hound
runic ruin
#

so beat that

#

wifi went out

sick hound
#

did you like google that

#

lmfao

runic ruin
#

nope

#

that's my own number

sick hound
#

wack

runic ruin
#

I'll pay you $100 to find a number larger than that that describes itself

sick hound
#

gonna need to get a gcc compiler and rewrite

#

but i don't have cpp

#

fuck

#

visual studio aint co-operating

runic ruin
#

Some things to speed up your code:

All numbers that describe themselves...

...have an even number of digits
...will never have a "pair" starting in 0

viscid nymph
#

ok I got it to 4 lines

runic ruin
#

show code

viscid nymph
#
while((v:=globals().get('v',-1)+1)+1):
    for i,j in enumerate((n:=str(v))[1::2]):
        if int(n[i*2])!=n.count(j) or len(str(v))%2:break
    else:print(v)
sick hound
#

oh

#

that's smart

viscid nymph
#

I added 1 because 0 is falsy

thin trout
#

That looks suspiciously esoteric

toxic jewel
#
(lambda x: __import__("sys").stdout.write(x.__add__(__debug__).__str__()))(__debug__)
#

forgot to evaluate ah

#

!e

(lambda x: __import__("sys").stdout.write(x.__add__(__debug__).__str__()))(__debug__)
night quarryBOT
#

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

2
toxic jewel
#

finally figured out how to do lambdas without assigning them to a variable

sick hound
#

lambdas are just unamed funcs

#

¯_(ツ)_/¯

drifting grove
#

!e

while (i:=globals().get('i',+1)+1):[bool(print(i)) if all([True if not (int(x) % 2) else False for x in str(i)]) else False]+[quit() if i>100 else False] 
night quarryBOT
#

@drifting grove :x: Your eval job has completed with return code 1.

001 | 2
002 | 4
003 | 6
004 | 8
005 | 20
006 | 22
007 | 24
008 | 26
009 | 28
010 | 40
011 | 42
... (truncated - too many lines)

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

toxic jewel
#

def():

#

!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__']
toxic jewel
#

was not aware that was a thing

drifting grove
#

Huh

toxic jewel
#

globals()

hard spoke
#

@slim stratus Why #esoteric-python? Or do you want the most intentionally horrible solution to this?

drifting grove
#

Ok
One bad solution coming right up
Unless I get stuck and give up

hard spoke
#

Have you read the channel description?

naive roost
#

you might want to ask for help in a general help channel

#

you are on the Python Discord server

#

all channels deal mostly with Python

drifting grove
#

!e

x='''
{
"3": {
"username": "Pazo",
"look": "sh-906-92.fa-3378-92-92.ch-255-110.hr-831-34.he-3082-92.hd-180-1359.lg-3116-1198-92.ha-3144-96-1428",
"motto": "pazo@hubba.to",
"rank": "12",
"rank_desc": "Hotelmanager"
},
"6292": {
"username": "Wassereis",
"look": "hd-605-2.ch-660-1198.he-3146-92.hr-3012-1403.lg-3057-1422.ca-3414-63",
"motto": "cat goes meow meow",
"rank": "5",
"rank_desc": "Moderator"
}
}'''

y=[__import__("json").loads(x)[z]["username"]for z in (__import__("json").loads(x))]
print (y)
night quarryBOT
#

@drifting grove :white_check_mark: Your eval job has completed with return code 0.

['Pazo', 'Wassereis']
drifting grove
#

Worst solution I can think of

hard spoke
#

hmm

#

you're doing it way too efficiently

drifting grove
#

Yeah
I'm on mobile rn so I can't type too much but maybe one of you have some improvements for it

hard spoke
#

!e

x='''
{
"3": {
"username": "Pazo",
"look": "sh-906-92.fa-3378-92-92.ch-255-110.hr-831-34.he-3082-92.hd-180-1359.lg-3116-1198-92.ha-3144-96-1428",
"motto": "pazo@hubba.to",
"rank": "12",
"rank_desc": "Hotelmanager"
},
"6292": {
"username": "Wassereis",
"look": "hd-605-2.ch-660-1198.he-3146-92.hr-3012-1403.lg-3057-1422.ca-3414-63",
"motto": "cat goes meow meow",
"rank": "5",
"rank_desc": "Moderator"
}
}'''

y=[__import__("json").loads(x).get(str(z))["username"]for z in range(0,100000) if __import__("json").loads(x).get(str(z)) is not None ]
print (y)
night quarryBOT
#

@hard spoke :white_check_mark: Your eval job has completed with return code 0.

['Pazo', 'Wassereis']
naive roost
#

still seems a bit too efficient

hard spoke
#

the ids seem to be numeric and small, so you can just iterate over them all

#

yeah, hmm

#

ah, I know

#

!e

x='''
{
"3": {
"username": "Pazo",
"look": "sh-906-92.fa-3378-92-92.ch-255-110.hr-831-34.he-3082-92.hd-180-1359.lg-3116-1198-92.ha-3144-96-1428",
"motto": "pazo@hubba.to",
"rank": "12",
"rank_desc": "Hotelmanager"
},
"6292": {
"username": "Wassereis",
"look": "hd-605-2.ch-660-1198.he-3146-92.hr-3012-1403.lg-3057-1422.ca-3414-63",
"motto": "cat goes meow meow",
"rank": "5",
"rank_desc": "Moderator"
}
}'''

y={__import__("json").loads(x).get(str(z))["username"] for z in (__import__("random").randint(0,100000) for i in range(0,1000000)) if __import__("json").loads(x).get(str(z)) is not None}
print (list(y))
night quarryBOT
#

@hard spoke :warning: Your eval job timed out or ran out of memory.

[No output]
naive roost
#

nice!

drifting grove
#

It's beautiful

hard spoke
#

!e

x='''
{
"3": {
"username": "Pazo",
"look": "sh-906-92.fa-3378-92-92.ch-255-110.hr-831-34.he-3082-92.hd-180-1359.lg-3116-1198-92.ha-3144-96-1428",
"motto": "pazo@hubba.to",
"rank": "12",
"rank_desc": "Hotelmanager"
},
"6292": {
"username": "Wassereis",
"look": "hd-605-2.ch-660-1198.he-3146-92.hr-3012-1403.lg-3057-1422.ca-3414-63",
"motto": "cat goes meow meow",
"rank": "5",
"rank_desc": "Moderator"
}
}'''

y=[__import__("json").loads(x).get(str(z))["username"] for z in {__import__("random").randint(0,100000) for i in range(0,1000000)} if __import__("json").loads(x).get(str(z)) is not None]
print(y)
night quarryBOT
#

@hard spoke :white_check_mark: Your eval job has completed with return code 0.

['Pazo', 'Wassereis']
hard spoke
#

weird, why did the previous one not work?..

naive roost
#

you use a set now

hard spoke
#

I did in the previous one too

#

but in a different place

naive roost
#

well, I think that the only obvious way to do worse now is to parse the json manually

night quarryBOT
#

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

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

__import__ is uglier

naive roost
#

because we're trying to give you the worst code possible

#

if you'd asked in a help channel, you might have had an understandable solution. Here? you get code hell 😄

twilit grotto
#

json isn't a big enough topic to give its own channel. you should use the help channels, check out #❓|how-to-get-help

#

this is not the ideal channel for help

toxic jewel
#

ah

#

!e

(lambda x: x.trunc(1.2))(__import__("math"))
night quarryBOT
#

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

[No output]
toxic jewel
#

nice

hard spoke
#

!e

call=lambda a,b,*args:getattr(__import__(a),b)(*args)
print(call("math","trunc",1.2))
night quarryBOT
#

@hard spoke :white_check_mark: Your eval job has completed with return code 0.

1
naive roost
#

!e ```py
call=lambda a,b,*args,**kwargs:getattr(import(a),b)(*args,**kwargs)
print(call("math","trunc",1.2))

night quarryBOT
#

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

1
toxic jewel
#

!e

(lambda a,b,*args:print(getattr(__import__(a),b)(*args)))("math","trunc",1.2)
#

o

night quarryBOT
#

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

1
sudden willow
#

gives me an idea

#

ah nvm over 2k chars

sick hound
#

??

sudden willow
#

its my hello world statement but no assigned lambda function

viscid nymph
#

I would rather

__import__('builtins').print()
#

wait no that's dumb

toxic jewel
#

!e

((__import__("sys").stdout.write(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(72)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(101)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(108)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(108)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(111)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(44)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(32)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(87)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(111)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(114)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(108)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(100)).__int__())][-(__debug__.__int__())]).__add__(chr(__:=[(lambda x:(x.__add__(__name__.__len__().__bool__().__int__())))(x) for x in range(ord(chr(33)).__int__())][-(__debug__.__int__())]))))))))))))))))```
night quarryBOT
#

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

Hello, World!
drowsy karma
#
a=[-6,-3,-2,-1,0,1,3,4,5,7,8,9,10,11,14,15,17,18,19,20,None]
c,d,n=1,0,[]
for i in a[:-1]:
 d+=1
 if i+1==a[d]:c+=1 
 else:
  if c>2:n+=f'{i-c+1}-{i}',
  else:
   q=[]
   for e in range(c):q+=f'{i-e}',
   n+=q[::-1]
  c=1
print(','.join(n))

any thoughts on shortening this?

#

i think i did the most possible, but im not sure if there's anything else?

#

any input would be greatly appreciated

toxic jewel
#

are you golfing?

analog rock
#

drowsy karma
#

@toxic jewel yes

#

here's the context:

#

individual integers
or a range of integers denoted by the starting integer separated from the end integer in the range by a dash, '-'. The range includes all integers in the interval including both endpoints. It is not considered a range unless it spans at least 3 numbers. For example "12,13,15-17"
Complete the solution so that it takes a list of integers in increasing order and returns a correctly formatted string in the range format.

Example:

solution([-6, -3, -2, -1, 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 17, 18, 19, 20])
# returns "-6,-3-1,3-5,7-11,14,15,17-20"```
toxic jewel
#

id reccomend using list comprehensions and (...)if condition else(...)

drowsy karma
#

sorry, im not familiar with those, do you have any resources for that? @toxic jewel

toxic jewel
#

for the other one:
instead of

condition = True
if condition: ...
else: ...

you can use

condition = True
(... if condition else ...)
drowsy karma
#

@toxic jewel will definitely check those out. thank you!

analog rock
#

are you counting chars or bytes?

drowsy karma
#

chars i believe?

analog rock
#

well in that case...

#

(give me a sec)

drowsy karma
#

thanks!

analog rock
#
exec("㵡ⵛⰶ㌭⴬ⰲㄭ〬ㄬ㌬㐬㔬㜬㠬㤬ㄬⰰㄱㄬⰴ㔱ㄬⰷ㠱ㄬⰹ〲丬湯嵥挊搬測ㄽ〬嬬੝潦⁲⁩湩愠㩛ㄭ㩝 ⭤ㄽ 晩椠ㄫ㴽孡嵤挺㴫‱ 汥敳਺†晩挠㈾渺㴫❦楻挭ㄫ⵽楻❽ਬ†汥敳਺†焠嬽੝†映牯攠椠慲杮⡥⥣焺㴫❦楻攭❽ਬ†渠㴫孱㨺ㄭ੝†㵣਱牰湩⡴Ⱗ⸧潪湩渨⤩".encode("u16")[2:])
#

🙃

drowsy karma
#

whoa

analog rock
#

lots more bytes, but lots fewer chars

#

depends what you're going for

#

and for reference I did ```py
print("""<insert code here>""".encode("u8").decode("u16"))

to get the special stuff
drowsy karma
#

lmaoo that's amazing, thanks! very interesting, didnt even kwow about that

analog rock
#

👍

#

if you are indeed counting chars it's a 94 char saving

#

and given it was originally 240 that's a lot

rustic aspen
#
x = 0
while x + 1 > x:
    x += 1
print(x)

how long will this take?

ripe osprey
#

It'll run forever right? Since python has arbitrary precision arithmetic?

rustic aspen
#

uh

#

what's arbitrary precision arithmetic?

ripe osprey
#

Sorry maybe I'm confusing terms

#

But that integer shouldn't overflow?

rustic aspen
#

and how does it store an integer inifnitely large?

#

like

ripe osprey
#

I'm not sure but once the integer exceeds the machine word size I think it switches to a different representation

rustic aspen
#

eventually there should simply not be any more space on my computer

#

oh

ripe osprey
#

I guess eventually you'll hit some kind of limit but you won't reach that print(x)

rustic aspen
#

so it is possible

frozen holly
#

Floating point numbers do have a limit, but integers dont

twilit grotto
#

python floats conform to ieeeeeeeeeeeeeeeeee754 doubles

frozen holly
#

!e ```py
print(import("sys").float_info

#

Oops

#

!e ```py
print(import("sys").float_info)

night quarryBOT
#

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

sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)
sick hound
#

nice

frozen holly
#

Max is real big omg

rustic aspen
#

!e
print(import("sys").int_info)

night quarryBOT
#

@rustic aspen :white_check_mark: Your eval job has completed with return code 0.

sys.int_info(bits_per_digit=30, sizeof_digit=4)
rustic aspen
#

wut

#

wtf does that mean

frozen holly
#

Idk

#

Look at the doca

rustic aspen
#

too lazy

#

im just going to assume from now on that python can store ints infinitely large

twilit grotto
#

it can

rustic aspen
#

technically not

twilit grotto
#

theoretically

rustic aspen
#

but practically yeah

twilit grotto
#

!e

print(2**100)
night quarryBOT
#

@twilit grotto :white_check_mark: Your eval job has completed with return code 0.

1267650600228229401496703205376
rustic aspen
#

no, no, i did 2^65536 it did it no probs

#

!e
print(69420**69420)

sick hound
#

nice

night quarryBOT
#

@rustic aspen :white_check_mark: Your eval job has completed with return code 0.

7270764247501992104640575426377036972876299645019310024924408647831052430449489473041861968435253505203716131370917392635349098527590031784285597289260323814555927234600202442196927986295710056957987838594801067981591652503176474554717039082148825209165504975568061380183760539388834079862400899597228363456885132158640742191417432496216530812785352371895877220299694581946039309165929616792614101159858891783318528312934440580697497709335517072451859635440799975739766809564223690984481779367495084944757931663226881260435233938168877023095760861204449014664944414145909331878732571492915937097848938945614598761899737932918352327967299282002944635755098819421999167155787613345618898731202555744373423729418759433057190669011041587225114127431421213848107427543740765079735041745824936061127608422590014052738382245825052372721865009035952624167346995134874653625486284847125561281606499752114242594787676082149939880652561537978726798505832992439908511557999940996653156876241170531591264409504503
... (truncated - too long)

Full output: too long to upload

sick hound
#

nice

rustic aspen
#

how were you that fast

#

is it possible to infinitely spaghettify your code?

sick hound
#

Yeah probably

next flame
#

recursively convert code into something of the form exec(chr(a)+chr(b)+chr(c)+...)

#

infinite size

earnest wing
#

parser stack overflow after N iterations

analog shadow
#

What your favorite easter egg?

#

!e import hello

night quarryBOT
#

@analog shadow :white_check_mark: Your eval job has completed with return code 0.

Hello world!
analog shadow
#

!e from future import braces

night quarryBOT
#

@analog shadow :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 | SyntaxError: not a chance
analog shadow
#

!e import this

night quarryBOT
#

@analog shadow :white_check_mark: Your eval job has completed with return code 0.

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/catolovone.txt

terse mortar
#

import antigravity is also kinda nice

rugged sparrow
#

!e import antigravity

night quarryBOT
#

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

[No output]
analog shadow
#

It attempts to open a browser to a comic

#

!e import antigravity;print(dir(antigravity))

night quarryBOT
#

@analog shadow :white_check_mark: Your eval job has completed with return code 0.

['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'geohash', 'hashlib', 'webbrowser']
analog shadow
#

!e import antigravity;print(antigravity.hashlib(antigravity.geohash))

night quarryBOT
#

@analog shadow :x: Your eval job has completed with return code 1.

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

And apparently geohash is a function someone made as a reference to a different XKCD comic

thin trout
frigid wharf
formal sandal
#

and connect the classes in an extremely confusing way, with metaclasses accessing MongoDB to perform dependency injection or something like that

frozen holly
#

Proof: any of my projects lol

sick hound
#

how would you obfuscate py code?

#

Could you use a crypter or do you have to use other methods?

last locust
#

!e py exec("㵡ⵛⰶ㌭⴬ⰲㄭ〬ㄬ㌬㐬㔬㜬㠬㤬ㄬⰰㄱㄬⰴ㔱ㄬⰷ㠱ㄬⰹ〲丬湯嵥挊搬測ㄽ〬嬬੝潦⁲⁩湩愠㩛ㄭ㩝 ⭤ㄽ 晩椠ㄫ㴽孡嵤挺㴫‱ 汥敳਺†晩挠㈾渺㴫❦楻挭ㄫ⵽楻❽ਬ†汥敳਺†焠嬽੝†映牯攠椠慲杮⡥⥣焺㴫❦楻攭❽ਬ†渠㴫孱㨺ㄭ੝†㵣਱牰湩⡴Ⱗ⸧潪湩渨⤩".encode("u16")[2:])

night quarryBOT
#

@last locust :white_check_mark: Your eval job has completed with return code 0.

-6,-3-1,3-5,7-11,14,15,17-20
last locust
#

That's one example

sick hound
#

...

#

tf

last locust
#

lol

#

Using u16 chars

sick hound
#

ah

last locust
#

!e py print(().__class__.__name__.__str__()[::-(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()).__sub__(().__class__.__name__.__str__().__len__().__sub__(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()).__sub__(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()).__sub__(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()).__sub__(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()).__sub__(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()).__sub__(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()).__sub__(().__class__.__name__.__str__().__len__().__sub__([1].__len__().__bool__().__str__().__len__()))))))))))])also stacking dunders

night quarryBOT
#

@last locust :white_check_mark: Your eval job has completed with return code 0.

tl
sick hound
#

Seems beyond me tbh

#

Does the python bot have measures in place for preventing people from executing malicious scripts

last locust
#

!e py print([globals().__setitem__('_', ~-~-(-~-~-~-~int()).__pow__(-~-~int()).__sub__((-~-~int()).__pow__(-~-~int()))), '\n'.join(map(str, map(__import__('\x72\x61\x6e\x64\x6f\x6d').choice, [[x for x in map(str, range(-~int(), -~(_).__pow__(-~-~int())))] for __ in range(_)])))][~-int()])

night quarryBOT
#

@last locust :white_check_mark: Your eval job has completed with return code 0.

001 | 62
002 | 20
003 | 13
004 | 10
005 | 23
006 | 6
007 | 79
008 | 2
009 | 40
010 | 75
last locust
#

That's one I did for generating 10 random numbers 1-100

#

When it's broken down it's pretty simple

#

But just from looking at it it's really ugly and "obfuscated"

sick hound
#

fair enough i suppose i ll look more into this. Thank you

snow beacon
#

There was a challenge a while back to create a code obfuscator, with results on the esoteric-python-challenges GitHub repo.

steep mural
#

!e

import sys

def __match__(obj):
    try:
        return obj.__match__
    except AttributeError:
        return obj.__eq__


class case:
    def __init__(self, o):
        self.o = o

    def __hash__(self):
        return 0

def match(x):
    f = sys._getframe(1)
    def wrapper(cases):
        for key, value in cases.items():
            if __match__(x)(key.o) or __match__(key.o)(x):
                exec(value, f.f_globals, f.f_locals)
    return wrapper


def x():
    y = 32
    match(1) ({
        case(0): (
            "print('0')"
        ),
        case(2): (
            "print('2')"
        ),
        case(1): (
            "print(y)"
        )
    })

x()
night quarryBOT
#

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

32
steep mural
#

Kinda cool

snow beacon
#

Quite concise, too.

lone gust
terse mortar
lone gust
#

No duh

#

Time to skedaddle

sick hound
#

!code

sick hound
#

lemon is lemon except when lemon is not lemon;
if lemon is juice lemon is lemon,
juice is lemon, but lemon is not lemon, lemon is juice, so never juice is lemon, lemon is juice

round violet
#

deep

sick hound
#

no

round violet
#

why not

sick hound
#

cuz it's not deep

round violet
#

damn

blissful crypt
#

if * is anything then is !* null

faint ether
#

Me vs @sick hound

verbal totem
# round violet why not

Cuz "lemon is lemon except when lemon is not lemon;
if lemon is juice lemon is lemon,
juice is lemon, but lemon is not lemon, lemon is juice, so never juice is lemon, lemon is juice" is not the same as "deep"

night quarryBOT
#

@verbal totem :white_check_mark: Your eval job has completed with return code 0.

False
verbal totem
#

How do I make this a single line lambda?

#

(Using the same concept)

analog rock
#

!e ```py
def is_even(a: int):
b = 0
ans = True
for _ in range(b, (-1 if b < 0 else 1)):
ans = not ans
return ans

print(is_even(6))

night quarryBOT
#

@analog rock :white_check_mark: Your eval job has completed with return code 0.

False
analog rock
#

that's what's confusing me

verbal totem
#

Hmm

analog rock
#

it always returns false

#

because you never use a

verbal totem
#

Oh bruh

#

!e

def is_even(a: int):
    ans = True
    for _ in range(a, (-1 if a < 0 else 1)):
        ans = not ans
    return ans

print(is_even(6)) 
night quarryBOT
#

@verbal totem :white_check_mark: Your eval job has completed with return code 0.

True
verbal totem
#

I'm trying to make this as unreasonable as possible, while still working

#

Ik how to get an even number

twilit grotto
#

of course, that's the point of this channel :P

verbal totem
#

Well I need helmp doing that

sick hound
night quarryBOT
#

Hey @sick hound!

It looks like you tried to attach file type(s) that we do not allow (.zip). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg, .webm, .webp, .flac, .afdesign, .m4a, .csv.

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

sick hound
#

oh

#

i wanted to post the source

restive pulsar
#
w=int(input("input weight: "));print(w*0.45 if input("K or L: ").lower()=="k" else w*2.2)```
#

can i make this shorter

#

maybe perhaps using a walrus operator'?

naive roost
#

if you really need the input prompts, the obvious way is:

print((w:=int(input("input weight: ")))*.45 if input("K or L: ") in 'Kk' else w*2.2)
#

does not seem much shorter, though

restive pulsar
#

hmm

#

nvm

#

thanks

naive roost
#

welcome

restive pulsar
#

yea it does not work if u input L

#

"w" is not defined

#

thats been happening to me the entire time so thats why i came here for help

#

lol

naive roost
#

oh, right I see, you need the execution order

frigid wharf
#
print(int(input("input weight: "))*(0.45if input("K or L: ")in"kK"else 2.2))```
naive roost
#

well, that works

restive pulsar
#

yea

#

thank u

fluid tree
#

Does anyone know how to define a native coroutine (so that inspect.iscoroutinefunction is True) in a oneliner? Ideally, I want to avoid calling types.CodeType. Using eval is obviously cheating. It must not hardcode any bytecode.

astral rover
#

!d types.coroutine

night quarryBOT
#
types.coroutine(gen_func)```
This function transforms a [generator](../glossary.html#term-generator) function into a [coroutine function](../glossary.html#term-coroutine-function) which returns a generator-based coroutine. The generator-based coroutine is still a [generator iterator](../glossary.html#term-generator-iterator), but is also considered to be a [coroutine](../glossary.html#term-coroutine) object and is [awaitable](../glossary.html#term-awaitable). However, it may not necessarily implement the [`__await__()`](../reference/datamodel.html#object.__await__ "object.__await__") method.

If *gen\_func* is a generator function, it will be modified in-place.

If *gen\_func* is not a generator function, it will be wrapped. If it returns an instance of [`collections.abc.Generator`](collections.abc.html#collections.abc.Generator "collections.abc.Generator"), the instance will be wrapped in an *awaitable* proxy object. All other types of objects will be returned as is.

New in version 3.5.
astral rover
#

should do it with a lambda

fluid tree
#

It isn't a native coroutine.

#

(Is it?)

#
False```
astral rover
#

well idk then

#

i thought that worked for it

fluid tree
#

It doesn't.

#

If you get an idea tag me, I don't really read discord

rugged sparrow
#

@fluid tree the reason why types.coroutine does not get marked as True is because it simply sets the flag CO_ITERABLE_COROUTINE on the function passed in. inspect.iscoroutinefunction checks the flag CO_COROUTINE

#

so what you can do is this

#

!e ```py
def coroutine(func):
co = func.code
func.code = co.replace(co_flags=co.co_flags|0x80)
return func

import inspect
print(inspect.iscoroutinefunction(coroutine(lambda: (() for () in ()))))```

night quarryBOT
#

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

True
astral rover
#

That uses CodeType though

rugged sparrow
#

it does not involve calling it

astral rover
#

ig

rugged sparrow
#

afaik that is the only way to produce it as that specific flag is only set when async def ... is compiled

blissful crypt
#

MY EYES

lone gust
#

What even is a lambda?

snow beacon
#

It's an 'anonymous function'. A demonstration:

def foo(x):
    return x + 1
# is equivalent to:
foo = lambda x: x + 1
#

Lambdas only have a single expression in them. You can't put for loops or try-except blocks in a lambda.

#

It's basically just lambda <PARAMETERS>: <RETURN VALUE>

#

You might use one when you have a small operation you want to perform, too small to warrant a function of its own. ```py
sort([-5, 4, -3, 2, -1], key=lambda number: abs(number))

#

(That's a bad example, because you could instead write ```py
sort([-5, 4, -3, 2, -1], key=abs)

fluid tree
snow beacon
fluid tree
#

Yeah

snow beacon
#

For try-except, did you have to import a module?

fluid tree
#

Try-catch took me over 1k characters though

#

Yes, sadly

#

I needed threading in order to comply with the pep (though most cases would work without it) and contextlib

#

I don't think it's possible without an import.

snow beacon
#

I suppose it's cheating to create a lambda then replace its __code__.

#

Or there was that not-ctypes thing abusing a lack of bounds checking in CPython to get memory access in pure Python, which also required editing bytecode.

fluid tree
#

But you can use types.FunctionType lol

snow beacon
#

Or create a lambda and replace its code.

fluid tree
#

Actually I think it's impossible

#

Yeah i can't create a generator without rewriting the entire thing into a line-by-line iterator and that's too much effort

radiant anchor
#

TIL a new technique

#

!e

𝓹𝓻𝓲𝓷𝓽("hello")
night quarryBOT
#

@radiant anchor :white_check_mark: Your eval job has completed with return code 0.

hello
cloud fossil
#

what's that fancy thing and why does it work

sudden osprey
#

!charinfo 𝓹𝓻𝓲𝓷𝓽("hello")

night quarryBOT
#
Character Info

\U0001d4f9: MATHEMATICAL BOLD SCRIPT SMALL P - 𝓹
\U0001d4fb: MATHEMATICAL BOLD SCRIPT SMALL R - 𝓻
\U0001d4f2: MATHEMATICAL BOLD SCRIPT SMALL I - 𝓲
\U0001d4f7: MATHEMATICAL BOLD SCRIPT SMALL N - 𝓷
\U0001d4fd: MATHEMATICAL BOLD SCRIPT SMALL T - 𝓽
\u0028 : LEFT PARENTHESIS - (
\u0022 : QUOTATION MARK - "
\u0068 : LATIN SMALL LETTER H - h
\u0065 : LATIN SMALL LETTER E - e
\u006c : LATIN SMALL LETTER L - l

Full Raw Text

\U0001d4f9\U0001d4fb\U0001d4f2\U0001d4f7\U0001d4fd\u0028\u0022\u0068\u0065\u006c\u006c\u006f\u0022\u0029

sudden osprey
#

I guess it just parses it as normal letters, interesting

frigid wharf
twilit grotto
#

that's...hilarious

thin trout
#

LMAO

finite rose
#

!e

import unicodedata
print(unicodedata.normalize('NFKC', '𝓹𝓻𝓲𝓷𝓽("hello")'))
night quarryBOT
#

@finite rose :white_check_mark: Your eval job has completed with return code 0.

print("hello")
cloud fossil
#

I guess we're going to see much more esoteric Python code from now on 😫

verbal totem
finite rose
verbal totem
#

Ik

finite rose
#

!e

p = 1
print(𝓹)
night quarryBOT
#

@finite rose :white_check_mark: Your eval job has completed with return code 0.

1
finite rose
#

this is amazingly evil

#

now I think I'm gonna get into esoteric python, not only browse this channel 😄

cloud fossil
#

oh my god

toxic jewel
#

!e

p = "p"
print(𝓹,𝓹,sep="")
night quarryBOT
#

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

pp
toxic jewel
#

amazing

frigid wharf
#

!e py helloworld = 'hello world' 𝑝𝓇𝕚𝑛𝑡(𝒽𝕖𝑙𝑙𝕠𝕨𝑜𝑟𝓁𝕕)

night quarryBOT
#

@frigid wharf :white_check_mark: Your eval job has completed with return code 0.

hello world
steep mural
#

It can normalize everything but these quotation marks ‘’ lol

finite rose
#

diacritics etc are also non-normalisable

#

all alphanumerics (without diacritics) with their alternatives:

from unicodedata import normalize
result_dict = {chr(i): [] for i in range(65, 65+26)}
result_dict.update({chr(i): [] for i in range(97, 97+26)})
result_dict.update({str(i): [] for i in range(10)})

for i in range(0x10FFFF):  # all valid inputs to chr - https://docs.python.org/3/library/functions.html#chr
    if (norm:=normalize("NFKC", c:=chr(i))) in result_dict:
        result_dict[norm].append(c)

print(result_dict)
#

for finding alternatives for all stuff, use defaultdict and get rid of if

#

!e

from unicodedata import normalize
result_dict = {chr(i): [] for i in range(65, 65+26)}
result_dict.update({chr(i): [] for i in range(97, 97+26)})
result_dict.update({str(i): [] for i in range(10)})

for i in range(0x10FFFF):  # all valid inputs to chr - https://docs.python.org/3/library/functions.html#chr
    if (norm:=normalize("NFKC", c:=chr(i))) in result_dict:
        result_dict[norm].append(c)
# for !e, let's show only some
print(result_dict["N"])
print(result_dict["1"])
print(result_dict["c"])
night quarryBOT
#

@finite rose :white_check_mark: Your eval job has completed with return code 0.

001 | ['N', 'ᴺ', 'ℕ', 'Ⓝ', 'N', '𝐍', '𝑁', '𝑵', '𝒩', '𝓝', '𝔑', '𝕹', '𝖭', '𝗡', '𝘕', '𝙉', '𝙽', '🄽']
002 | ['1', '¹', '₁', '①', '1', '𝟏', '𝟙', '𝟣', '𝟭', '𝟷', '🯱']
003 | ['c', 'ᶜ', 'ⅽ', 'ⓒ', 'c', '𝐜', '𝑐', '𝒄', '𝒸', '𝓬', '𝔠', '𝕔', '𝖈', '𝖼', '𝗰', '𝘤', '𝙘', '𝚌']
finite rose
#

!e

ⓗ𝕖𝘭l𝙤 = "Hello world!" 
𝕡ʳ𝚒𝚗𝑡(𝗁𝖊l𝖑ₒ)
night quarryBOT
#

@finite rose :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     ⓗ𝕖𝘭l𝙤 = "Hello world!"
003 |     ^
004 | SyntaxError: invalid character 'ⓗ' (U+24D7)
finite rose
#

huh, weird, it's one of the characters that were normalized correctly...

#

!e

h𝕖𝘭l𝙤 = "Hello world!" 
𝕡ʳ𝚒𝚗𝑡(𝗁𝖊l𝖑ₒ)
night quarryBOT
#

@finite rose :white_check_mark: Your eval job has completed with return code 0.

Hello world!
finite rose
#

!e

from unicodedata import normalize, category
result_dict = {chr(i): [] for i in range(65, 65+26)}
result_dict.update({chr(i): [] for i in range(97, 97+26)})
result_dict.update({str(i): [] for i in range(10)})

for i in range(0x10FFFF):  # all valid inputs to chr - https://docs.python.org/3/library/functions.html#chr
    if (norm:=normalize("NFKC", c:=chr(i))) in result_dict and category(c) not in ["No", "So"]:
        result_dict[norm].append(c)

print(result_dict["H"])
print(result_dict["e"])
print(result_dict["1"])
print(result_dict["l"])
print(result_dict["0"])
night quarryBOT
#

@finite rose :white_check_mark: Your eval job has completed with return code 0.

001 | ['H', 'ᴴ', 'ℋ', 'ℌ', 'ℍ', 'H', '𝐇', '𝐻', '𝑯', '𝓗', '𝕳', '𝖧', '𝗛', '𝘏', '𝙃', '𝙷']
002 | ['e', 'ᵉ', 'ₑ', 'ℯ', 'ⅇ', 'e', '𝐞', '𝑒', '𝒆', '𝓮', '𝔢', '𝕖', '𝖊', '𝖾', '𝗲', '𝘦', '𝙚', '𝚎']
003 | ['1', '1', '𝟏', '𝟙', '𝟣', '𝟭', '𝟷', '🯱']
004 | ['l', 'ˡ', 'ₗ', 'ℓ', 'ⅼ', 'l', '𝐥', '𝑙', '𝒍', '𝓁', '𝓵', '𝔩', '𝕝', '𝖑', '𝗅', '𝗹', '𝘭', '𝙡', '𝚕']
005 | ['0', '0', '𝟎', '𝟘', '𝟢', '𝟬', '𝟶', '🯰']
azure hamlet
#

whats unicode and ascii

proper vault
#

text encodings

#

essentially, a way to convert a sequence of characters to bytes

#

and back

azure hamlet
#

thanks

odd ferry
#

!e

def f():
    print('Previous line repeated [992] times')
    f()
f()
night quarryBOT
#

@odd ferry :x: Your eval job has completed with return code 1.

001 | Previous line repeated [992] times
002 | Previous line repeated [992] times
003 | Previous line repeated [992] times
004 | Previous line repeated [992] times
005 | Previous line repeated [992] times
006 | Previous line repeated [992] times
007 | Previous line repeated [992] times
008 | Previous line repeated [992] times
009 | Previous line repeated [992] times
010 | Previous line repeated [992] times
011 | Previous line repeated [992] times
... (truncated - too many lines)

Full output: too long to upload

odd ferry
#

:)

#

sad

snow beacon
# proper vault essentially, a way to convert a sequence of characters to bytes

Some extra information: Unicode is kind of three different text encodings. UTF-8 is the one everyone uses, UTF-32 is the one some computer systems use internally, and UTF-16 is the one everyone hates. ASCII is the format used by old computer systems, or programmers who don't mind that it can only display English symbols. Unicode has >100,000 symbols, while ASCII fits into a byte.

frozen holly
night quarryBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

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

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

#

@gilded adder :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     def test():
003 |                ^
004 | IndentationError: expected an indented block
#

@gilded adder :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     def test():
003 |                ^
004 | IndentationError: expected an indented block
#

@gilded adder :warning: Your eval job has completed with return code 0.

[No output]
#

@gilded adder :x: Your eval job has completed with return code 1.

001 | Enter your name: Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 |   File "<string>", line 2, in x
004 | EOFError: EOF when reading a line
last locust
#

@gilded adder #bot-commands for testing please (and the bot doesn't support input)

earnest wing
floral meteor
snow beacon
#

You can eliminate a space on the fourth line after the else.

floral meteor
#

ty

#

I started making it readable then i'm like (╯°□°)╯︵ ┻━┻

#

next puzzle

has_admin=lambda f:lambda m,*args:len([_ for _ in m.author.roles if _.name.lower()=='admin'])and f(m,*args)or{'async':[],'sync':['that command requires a role called admin.']}
snow beacon
#
len([_ for _ in m.author.roles if _.name.lower()=='admin'])
```is```python
[u.name.lower()for u in m.author.roles].count("admin")
#
has_admin=lambda f:lambda m,*args:len([_ for _ in m.author.roles if _.name.lower()=='admin'])and f(m,*args)or{'async':[],'sync':['that command requires a role called admin.']}
```is```py
has_admin=lambda f:lambda*args:len([_ for _ in args[0].author.roles if _.name.lower()=='admin'])and f(*args)or{'async':[],'sync':['that command requires a role called admin.']}
```although it only matters if you shorten `args`' name.
#

I assume f always returns something truthy.

frigid wharf
#

!e ```py
import ast
from unicodedata import normalize, category
import random

variations = {}

for i in range(0x10FFFF):
if category(c:=chr(i)) in ('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl'):
norm = normalize("NFKC", c)
if norm in variations:
variations[norm].append(c)
else:
variations[norm] = [c]

def randomize_identifiers(code):
c = ast.parse(code)
for i in ast.walk(c):
try:
i.id = ''.join(random.choice(variations.get(char, char)) for char in i.id)
except AttributeError:
pass
return ast.unparse(c)

print(randomize_identifiers('''hello_world = "hello world"
print(hello_world)'''))```

night quarryBOT
#

@frigid wharf :white_check_mark: Your eval job has completed with return code 0.

001 | 𝚑𝗲ⅼ𝖑𝔬_𝘄𝚘𝕣𝖑𝒅 = 'hello world'
002 | 𝗉𝓻ⅈ𝖓ᵗ('hello_world')
frigid wharf
#

a script which randomizes identifiers in a script

thin trout
#

variations[norm] = []
Shouldn’t that be variations[norm] = [c]?

snow beacon
#

Where did the extra quote marks come from?

frigid wharf
#

i edited the script and didn't reevaluate the output

boreal slate
#
import sys
print(sum(int(x)if x.isdigit()else ord(x)for x in sys.argv[1].split(',')))
``` anyway to shortern this?
proper vault
#

(ord,int)[x.isdigit()](x)maybe

boreal slate
#

yeah, i was doing that, but messed up

#
import sys
print(sum((ord,int)[x.isdigit()](x)for x in sys.argv[1].split(',')))
fluid tree
fluid tree
thin trout
earnest wing
#

parse AST and replace the appropriate nodes?

#

of course won't catch getattr or globals() mess

fluid tree
finite rose
boreal slate
#

after this amma try the longest 😛

proper vault
#
import sys
for i in range(128):vars()[chr(i)]=i
print(sum(eval(sys.argv[1])))
``` if you are a bad person and can guarantee that between the commas it is only valid identifiers
boreal slate
proper vault
#

it creates a variable with the every single character letter as the name and it's ord as the value

#

so eval will use it

boreal slate
#

ah smart

proper vault
#
def fun():
    val = yield from (yield (yield from (yield fun())))
    if val is fun:
        yield [['You'], ['Win']]
    else:
        raise ValueError
```get the `[['You'], ['Win']]` list from the `fun()` generator by making the yield actually run.
astral rover
#

print([list(next(iter(fun())).gi_code.co_consts[-2:])]) makes the yield run ig

proper vault
#

[['You', 'Win']] is not [['You'], ['Win']]

astral rover
#

oh yeah my bad

sterile breach
#

what is this

terse mortar
stark fable
#

!e ```py
def fun():
val = yield from (yield (yield from (yield fun())))
if val is fun:
yield [['You'], ['Win']]
else:
raise ValueError

def wut():
return fun
yield

gen = fun()
next(gen)
gen.send([])
print(gen.send(wut()))```

night quarryBOT
#

@stark fable :white_check_mark: Your eval job has completed with return code 0.

[['You'], ['Win']]
stark fable
#

@proper vault

errant sleet
#

can anyone help me?

naive roost
#

don't ask to ask, and just ask your question anyway

#

there's someone here pretty much at all times

errant sleet
#

ok Consider the following code:

val = 25

def example():
  global val
  val = 15
  print (val)

print (val)
example()
print (val)
What is output?

naive roost
#

you might want to ask that kind of stuff in a general help channel in the future, though it is a bit weird I have to admit

errant sleet
#

ok

analog rock
#

well ```py
25
15
15

#

surely

#

yeah

stark fable
#
factorial = lambda b:(lambda a:a(a))(lambda a:lambda b:(lambda c:lambda d:a(a)(b-1)(c)(c(d)))if b else lambda a:lambda a:a)(b)(lambda b: lambda a:a(b(lambda a:lambda a:a)(b(lambda a:lambda b:a)(lambda a:lambda b:lambda c:a(b)(b(c))))(lambda a:lambda a:a))(lambda a:lambda c:b(lambda a:lambda a:a)(a)(a(c))))(lambda a:a(lambda a:a)(lambda a:a))(lambda a:lambda b:a)(lambda a:a+1)(0)``` why does this fail on numbers above 7, if you don't know that you probably shouldn't be in this channel
errant sleet
#

thanks

proper vault
#

nice @stark fable

stark fable
#
def wut():
    return fun
    yield``` this function is pretty funny
proper vault
#

yeah

stark fable
#

that yield is never actually executed but it still causes the function to be a generator

naive roost
#

so if you execute it, it you do a Stopiteration: fun, wouldn't it?

stark fable
#

yeah i think that's what happens

proper vault
#

yup

#

it is how coroutines return their values

naive roost
#
>>> sys.setrecursionlimit(5042)
>>> factorial(7)
Traceback (most recent call last):
  File "<stdin>", line 1, in <lambda>
  File "<stdin>", line 1, in <lambda>
  File "<stdin>", line 1, in <lambda>
  [Previous line repeated 997 more times]
RecursionError: maximum recursion depth exceeded
>>> sys.setrecursionlimit(5043)
>>> factorial(7)
5040
``` nice!
#

only 5043 stack frames needed for 7! How many for 8!?

#

okay, it just segfaulted my interpreter 😂

low apex
#

!e ```py
#Empty class
empty = type("Empty", (), {})

#Adding a method and a field to Empty
def XplusY(self):
print(self.X + " and " + self.Y)

empty.Y = "This is Y"
empty.XplusY = XplusY

#Testing with instance
instance = empty()
instance.X = "This is X"
instance.XplusY()

night quarryBOT
#

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

This is X and This is Y
low apex
#

Best way to make a class?!?!

snow beacon
#

instance = type("Empty", (), {"Y":"This is Y", "XplusY":lambda self: print(self.X, "and", self.Y)})

low apex
#

I know I know, I just liked the idea of adding stuff to the class after its definition

analog shadow
#

!e hash(-2)==hash(-1)

night quarryBOT
#

@analog shadow :warning: Your eval job has completed with return code 0.

[No output]
analog shadow
#

!e print(hash(-2) == hash(-1))

night quarryBOT
#

@analog shadow :white_check_mark: Your eval job has completed with return code 0.

True
analog shadow
#

Why?????!!

rugged sparrow
#

@analog shadow -1 is a reserved value for hash (if -1 is returned, then CPython assumes an error was meant to be raised)

analog shadow
#

So is hash only meant to be used on positive numbers? I thought that certain parts of python hashed things to compare equality

#

Like dict lookups

snow beacon
#

It's only -1 that represents an error, I believe.

#

!e ```py
print(hash(-2))

night quarryBOT
#

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

-2
snow beacon
#

The other negatives are fine, as you can see.

floral meteor
#

!e alright I made this thing

(c1:=(c0:=....__class__.__class__("Cursed",(object,),{'__init__':(lambda s,*a:s.__class__(*[(f:=a[0]),*f(*a[1:])]))}))(lambda *a:[print(*a,sep='\n')or c0],4,2,0))(lambda*a:None,None)

and halfway through writing it i forgot why i was writing it

#

!e ```py
(c1:=(c0:=....class.class("Cursed",(object,),{'init':(lambda s,a:s.class([(f:=a[0]),*f(*a[1:])]))}))(lambda *a:[print(a,sep='\n')or c0],4,2,0))(lambdaa:None,None)

night quarryBOT
#

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

001 | 4
002 | 2
003 | 0
004 | <class '__main__.Cursed'>
005 | <class '__main__.Cursed'>
006 | <class '__main__.Cursed'>
007 | <class '__main__.Cursed'>
008 | <class '__main__.Cursed'>
009 | <class '__main__.Cursed'>
010 | <class '__main__.Cursed'>
011 | <class '__main__.Cursed'>
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

oh i see

floral meteor
#

okay question: will this work in an async function?

except Exception as e:await ....__class__.__class__("cursedcoro",(client.fetch_member(0).__class__,),{'__await__':staticmethod(lambda:print(f"{e.__class__.__name__}: {e}"))})
snow beacon
#

__await__ will be None?

floral meteor
#

how about now?

#

or will the lambda need to be in brackets?

snow beacon
#

No brackets necessary, but are those all the parameters you need?

floral meteor
#

I've got e, I just wanna obfuscate printing the error :P

#

and client is global

#

don't ask why I'm obfuscating a discord bot

snow beacon
#

But do you need a self?

floral meteor
#

tru dat

snow beacon
#

Or staticmethod if you want to be more obfuscated.

floral meteor
#

!e ```py
print(staticmethod)

night quarryBOT
#

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

<class 'staticmethod'>
snow beacon
#

It's a decorator.

floral meteor
#

funnily enough ....__class__.__class__ is slightly more readable than type

snow beacon
#

I'm not sure I agree.

floral meteor
#

type is like what's a type oh that's the mechanics behind class.
....class.class is like hey that's the class class!

snow beacon
#

type(type)(type(type)) is type.

floral meteor
#

maybe i hang around here too much

snow beacon
#

Whenever I see a dunder beginning with 'c' I assume it's __call__.

floral meteor
#

!e ```py
print(....class.class(....class.class)(....class.class(....class.class))==type)

night quarryBOT
#

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

True
snow beacon
#

is rather than == would be more precise.

floral meteor
#

but then id need a space after the s

snow beacon
#

I wasn't aware you were aiming for concision.

floral meteor
#

lmao

snow beacon
#

Also, you've got extra spaces before all of the brackets.

floral meteor
#

yeah that was a copy paste accident

snow beacon
#

Excuse me while I silently raise an eyebrow.

floral meteor
#

if the fear of space is called astrophobia, and the fear of lack of space is claustrophobia, what does that make the fear of spaces?

#

claustrophilia?

snow beacon
#

Astrophobias?

#

One fear of space = 'astrophobia'. Two fear of spaces = 'astrophobias'.

floral meteor
#

ithinkclaustrophiliaisspoton

#

[or,should,i,do,this,instead]?

#

!e ```py
print({'going'+chr(32)+'insane':True})

night quarryBOT
#

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

{'going insane': True}
floral meteor
#

!e ```py
print.call((lambda*d:f"{d[0].iter().next()},{d[0][d[0].iter().next()]}".replace(',',chr(32)))({'Hello':"World!"}))

night quarryBOT
#

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

Hello World!
floral meteor
#

claustrophilic Hello World script with a .call added so the print keyword would colour in the slightly inaccurate discord colouration

snow beacon
#

!e ```py
print("Hello","World!")

night quarryBOT
#

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

Hello World!
floral meteor
#

well that works too, but that's easy to read

#

and i did use a comma :P

snow beacon
#

I wrote a hello world without imports or brackets a while back.

floral meteor
#

no brackets, so no __call__ing so no print or sys.stdout.write

snow beacon
#

That's not entirely true.

#

The latter certainly requires an import.

floral meteor
#

aye

#

so no sys.stdout.write

#

!e
so we have print what can we do with that?

print(dir(print.__call__.__code__))
night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: 'method-wrapper' object has no attribute '__code__'
floral meteor
#

method wrapper

snow beacon
#

It's built-in, so it has no code.

floral meteor
#

!e print(dir(print.call.class))

night quarryBOT
#

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

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

You can call some things without brackets. For instance, ~x calls x.__invert__().

floral meteor
#

aha

#

AAAAHHHH I know what to do

snow beacon
#

You can also define functions without brackets, e.g. lambda x, *y, **z: z + y + z.

#

I reckon you'll hit some roadblocks, but I've got to go now.

floral meteor
#

yeah a class still needs to ba called

#

i can use an object that already exists!

#

!e ```py
exit.inverse.call=print.call
~exit

night quarryBOT
#

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

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

!e ```py
exit()

night quarryBOT
#

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

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

ahaahaahaha

#

!e ```py
s="yeet"
s.inverse=print
~s

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: 'str' object has no attribute '__inverse__'
floral meteor
#
>>> class
  File "<stdin>", line 1
    class
         ^
SyntaxError: invalid syntax
>>> class=4
  File "<stdin>", line 1
    class=4
         ^
SyntaxError: invalid syntax
>>> globals().update({'class':'ahahaahahaahaha'})
>>> class
  File "<stdin>", line 1
    class
         ^
SyntaxError: invalid syntax
>>> globals()
{'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': None, '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, 'class': 'ahahaahahaahaha'}
#

!e ```py
n=69
n.neg=print
-n

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: 'int' object attribute '__neg__' is read-only
floral meteor
#

!e ```py
try:raise Exception
except Exception as e:e.neg=print;-e

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | Exception
004 | 
005 | During handling of the above exception, another exception occurred:
006 | 
007 | Traceback (most recent call last):
008 |   File "<string>", line 2, in <module>
009 | TypeError: bad operand type for unary -: 'Exception'
floral meteor
#

!e ```py
print(int.setattr)

night quarryBOT
#

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

<slot wrapper '__setattr__' of 'object' objects>
floral meteor
#

!e object.inverse

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: type object 'object' has no attribute '__inverse__'
floral meteor
#

!e object.neg

night quarryBOT
#

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

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

!e object.neg

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: type object 'object' has no attribute '__neg__'
floral meteor
#

!e ....neg

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: 'ellipsis' object has no attribute '__neg__'
floral meteor
#

!e ....gt

night quarryBOT
#

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

[No output]
floral meteor
#

!e ```py
a=...
a.setattr=print
a.Hello='World!'

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: 'ellipsis' object attribute '__setattr__' is read-only
floral meteor
#

what isn't read-only?

#

!e ```py
class a:...
a.neg=print
-a

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | TypeError: bad operand type for unary -: 'type'
floral meteor
#

!e ```py
....str=lambda s:"yeet"

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: 'ellipsis' object attribute '__str__' is read-only
floral meteor
#

!e ```py
def a:...

night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     def a:...
003 |          ^
004 | SyntaxError: invalid syntax
floral meteor
#

!e ArithmeticError.a=4

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: can't set attributes of built-in/extension type 'ArithmeticError'
lone scarab
#

!e

lis = [[[[[[[[[["Hello, world!",[]],[]],[]],[]],[]],[]],[]],[]],[]],[]]
print(lis[0][0][0][0][0][0][0][0][0][0])
night quarryBOT
#

@lone scarab :white_check_mark: Your eval job has completed with return code 0.

Hello, world!
floral meteor
#

!e ```py
(lis:=list()).append(lis)
lis[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]=lis
lis.str='hello world'
lis.neg=print
-lis

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | AttributeError: 'list' object attribute '__str__' is read-only
floral meteor
#

okay apparently the fear of whitespace is called horror vacui

snow beacon
#

That's a lot of bot executions. I guess it's in your name.

#

I feel bad for having led you down something that's probably the wrong path.

#

I didn't use ~, - etc for my hello world.

#
In [1]: x = lambda:0
In [2]: x.__invert__ = print
In [3]: ~x
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
----> 1 ~x
TypeError: bad operand type for unary ~: 'function'
```This doesn't work, for one.
#

Using dunder methods is one of multiple ways to call functions.

stark fable
#

idk about them but i just found a solution and it uses ||decorators||

#

(spoilering that because it's quite a major hint)

boreal slate
#

I love how you use those images even tho your nitro ended lemon_hyperpleased

stark fable
#
x=lambda*_:'hello world'
@print
@x
class A:0```
sudden osprey
#

Or in 3.9

@print
@lambda*_:'hello world'
class A:0

Now I understand the use case of expressions in decorators 😛

thin trout
#

Haha

low apex
#

We have private methods and public methods, how about unlockable methods?

class Base:

    x = 3

    def __init__(self, y):
        self.y = y

    def x_Plus_y(self):
        return self.x + self.y

    @classmethod
    def unlock_More_Methods(cls):
        
        cls.x_Times_y = lambda self: self.x * self.y

        @staticmethod
        def hello_World():
            print("Hello World!")

        cls.hello_World = hello_World
elfin notch
#

hello guys can someone help me? my vscode doesn't color my string, is that correct?
print('\033[0;31;43mText\033[m')

my terminal send this
←[1;32mText←[m

wanton jacinth
#

i tried it in pycharm

#

never seen a colored output like this before ^^

elfin notch
#

In Pycharm this work, but in vscode this don't work ;-;

wanton jacinth
#

and when u run via terminal?

elfin notch
elfin notch
wanton jacinth
#

yes in terminal it dont work

elfin notch
#

It is to sad 😢

#

I will find a method to resolve this

#

Thanks 😊

wanton jacinth
#

yes, that would have been very nice for my scripts too....but..

#

if you find something you can let me know?

#

try it in a bash

#

i think it will work there

wanton jacinth
#

yes

#

it will work

elfin notch
#

I don't use bash

#

;-;

#

@wanton jacinth i think this will help you to use colors and styles in python

elfin notch
#

@wanton jacinth hey i found one way to use it in vscode, you shoud use "import colorama and colorama.init()" and later use print('\033[0;31;43mText\033[m')

#

===============================================
from termcolor import colored
import colorama
colorama.init()

#this way uses termcolor, is too easy to use
print(colored('this way wil work', 'blue'))

#This way is confusing to understand, but it works to
print('\033[0;31;43mText\033[m')

wanton jacinth
#

yeah nice thanks 🙂

#

@elfin notch ❤️

sudden willow
#

!e __𝓲𝓶𝓹𝓸𝓻𝓽__("__hello__")

night quarryBOT
#

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

Hello world!
floral meteor
#

Must be empty string

floral meteor
#

This function will abstract away printing green text

def get_print_green(__l,name='print_green',default=__import__('sys').stdout):
   print_green=lambda*args,sep=chr(32),end=chr(10),file=default:__import__('os').system("")or file.write(f"\x1b[32m{sep.join(args)}{end}\x1b[0m")
   __l.update({name:print_green})
get_print_green(locals())
#

I did not know you could decorate classes

#

#

!e ```py
@print
@lambda*_:"I am invincible!"
class __:...

night quarryBOT
#

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

I am invincible!
floral meteor
#

!e ```py
@print
def yeet(s): return s
yeet('hi')

night quarryBOT
#

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

001 | <function yeet at 0x7f79c7ddd040>
002 | Traceback (most recent call last):
003 |   File "<string>", line 3, in <module>
004 | TypeError: 'NoneType' object is not callable
floral meteor
#

!e a=lambda*_:None
a.str="Hello World!"
@print
a

night quarryBOT
#

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

001 |   File "<string>", line 4
002 |     a
003 |     ^
004 | SyntaxError: invalid syntax
floral meteor
#

Awwwww

floral meteor
#

Now I'm thinking of.................................

#
            | O
_________________________
 A |  | B  | C   | N    | M

Such that

O=(A&B&C&not+N)^M
#

now we make that a class, connect Os to respective letters and connect some input nodes to stimuli and boom we've made something like a brain

toxic jewel
#

!e

(lambda*x:print(x[0]))("test")
#

huh

floral meteor
#

lel

night quarryBOT
#

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

test
floral meteor
#

try starring both xs

toxic jewel
#

hmm

floral meteor
#

!e ```py
(lambda*x:print(*x))("test")

night quarryBOT
#

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

test
floral meteor
#

boom

toxic jewel
#

quirky

#

wait that counts as one var?

floral meteor
#

!e (lambda*x:print(*x))("Hello","World!")

night quarryBOT
#

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

Hello World!
floral meteor
#

you know what's quirky?

toxic jewel
#

!e

(lambda*:print(*))("test")
night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     (lambda*:print(*))("test")
003 |             ^
004 | SyntaxError: named arguments must follow bare *
floral meteor
#

!e ```py
@print
@lambda*_:"Hello World"
class _:...

night quarryBOT
#

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

Hello World
toxic jewel
#

!e

@print
@{}.__class__
floral meteor
#

you need a class

toxic jewel
#

!e

@print
@{}.__class__
class _:...
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 | TypeError: 'type' object is not iterable
toxic jewel
#

wait so i can fit all my non-space code in a decorator?

#

!e

@print
@(lambda*x:print(x))("t")
class _:...
night quarryBOT
#

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

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

huh

floral meteor
#

!e ```py
@print
@lambda :.name
class _:name="Hello World!"

night quarryBOT
#

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

_
toxic jewel
#

woah

floral meteor
#

!e ```py
@print
@lambda :.str
class _:str="Hello World"

night quarryBOT
#

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

Hello World
toxic jewel
#

!e e=1j;print(e)

night quarryBOT
#

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

1j
toxic jewel
#

sucks that i can't fit my decorators into one line

floral meteor
#

!e ```py
@print
@lambda :.complex
class _:complex=1j

night quarryBOT
#

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

1j
floral meteor
#

oh you want one-liners? You need a lot of brackets

toxic jewel
floral meteor
#

!e ```py
c=lambda*d:lambda f:[(f:=e(f))for e in reversed(d)]
@c(print,lambda :.)
class _:
="Hello World"

night quarryBOT
#

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

Hello World
floral meteor
#

like that?

toxic jewel
#

interesting

#

mhm

#

why reversed?

floral meteor
#

otherwise you'd be calling the lambda on the print on the class when you want to print the lambda of the class

toxic jewel
#

aren't decorators just calling decorator_name(func) aswell

floral meteor
#

yes

#

so...

toxic jewel
#

hmmmmmmmmmmmmmmmmmm

#

i can finally create my oneline discord bot

floral meteor
#

!e [lambda*d:lambda f:[(f:=e(f))for e in reversed(d)]][""==()].__call__(print,lambda _:_.__).__call__(....__class__.__class__("",(),{'__':"Hello World"}))

night quarryBOT
#

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

Hello World
toxic jewel
#

going 2 brag 2 mudkip that i finally know how his code works brb

floral meteor
#

!e ```py
[lambdad:lambda f:[(f:=e(f))for e in reversed(d)]][str()==()].call(print,lambda :.).call(....class.class(().str().class(),().class(),{'':11'%c'%(lambdaa:([+t+100for t in a],))(-28,--1,--8,--8,11,-68,-13,11,14,--8,+0)}))

night quarryBOT
#

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

Hello World
floral meteor
#

@toxic jewel how about the above?

toxic jewel
#

damn

floral meteor
#

I do believe that if you append a [0] it will also return the value

#

as well as printing

#

!e ```py
print([lambdad:lambda f:[(f:=e(f))for e in reversed(d)]][str()==()].call(print,lambda :.).call(....class.class(().str().class(),().class(),{'':11'%c'%(lambdaa:([+t+100for t in a],))(-28,--1,--8,--8,11,-68,-13,11,14,--8,+0)}))[0])

night quarryBOT
#

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

001 | Hello World
002 | Hello World
floral meteor
#

you see?

plucky wedge
#

wizardry

floral meteor
#

!e ```py
print(~[0,1,2,3,4,5])

night quarryBOT
#

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

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

awww

#

!e ```py
a,b,c='abc'
print(b)

night quarryBOT
#

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

b
floral meteor
#

!e print(("YEET"))

night quarryBOT
#

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

001 |   File "<string>", line 1
002 |     print(*(*"YEET"))
003 |             ^
004 | SyntaxError: can't use starred expression here
floral meteor
#

print(*"awww")

#

!e print(*"AAAAAAA")

night quarryBOT
#

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

A A A A A A A
floral meteor
#

!e print(*"\n"*8,sep="A "*8,end='\n\n')

night quarryBOT
#

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

001 | 
002 | A A A A A A A A 
003 | A A A A A A A A 
004 | A A A A A A A A 
005 | A A A A A A A A 
006 | A A A A A A A A 
007 | A A A A A A A A 
008 | A A A A A A A A 
floral meteor
#

!e print(*['']*8,sep=' '.join('A'*8)+'\n')

night quarryBOT
#

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

001 | A A A A A A A A
002 | A A A A A A A A
003 | A A A A A A A A
004 | A A A A A A A A
005 | A A A A A A A A
006 | A A A A A A A A
007 | A A A A A A A A
floral meteor
#

!e ```py
print_n_times=lambda n:lambda f:lambdaargs,sep=' ',end='\n':print(['']*n,sep=sep.join(args)+end)
@print_n_times(8)
def yeet(args,**kwargs):...
yeet(
"A"*8)

night quarryBOT
#

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

001 | A A A A A A A A
002 | A A A A A A A A
003 | A A A A A A A A
004 | A A A A A A A A
005 | A A A A A A A A
006 | A A A A A A A A
007 | A A A A A A A A
floral meteor
#

!e ```py
def matrix(a,b):
def a(f):
def w(letter):
@(lambda n:lambda f:lambdaargs,sep=' ',end='\n':print(['']*n,sep=sep.join(args)+end))(a)
def yeet(*args,**kwargs):...
yeet(letterb);return letter
return w
return a
@matrix(8,8)
def b(letter):...
b("A")

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 11, in <module>
003 |   File "<string>", line 6, in w
004 |   File "<string>", line 4, in <lambda>
005 | TypeError: can't multiply sequence by non-int of type 'function'
floral meteor
#

alrighty then here goes

#

!e ```py
def matrix(a,b):
def a(f):
def w(l):
def k(n):
def c(g):
def p(s,sep=' ',end='\n'):print(['']*n,sep=sep.join(s)+end)
return p
return c
@k(a)
def yeet(*args,**kwargs):...
yeet(lb);return letter
return w
return a
@matrix(8,8)
def _(o):...
_("A")

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 16, in <module>
003 |   File "<string>", line 11, in w
004 |   File "<string>", line 6, in p
005 | TypeError: can't multiply sequence by non-int of type 'function'
floral meteor
#

huh

#

I'm confused how fix error?

floral meteor
#

maybe i should name the varibles in order

#

!e ```py
def a(b,c):
def d(e):
def f(g):
def h(i):
def j(k):
def l(m,n=' ',o='\n'):
print(
['']*i,sep=n.join(m)+o)
return l
return j
@d(b)
def p(*q,**r):...
p(gc);return g
return f
return d
@a(8,8)
def s(t):...
s("A")

night quarryBOT
#

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

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

all i did was rename stuff

#

alright reject def embrace lambda

#

nah i think i'll go to sleep

floral meteor
#

!e ```py
def a(A):
def b(B):
def c(C):
def d(D):
def e(E):
def F(f):return lambda:f(A,B,C,D,E)
return F
return e
return d
return c
return b
@a(1)(2)(3)(4)(5)
def yeet(*args):print(*args,sep='\n')
yeet()

night quarryBOT
#

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

001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
floral meteor
#

!e ```py
def a(A):
def b(B):
def c(C):
def d(D):
def e(E):
def f(F):return lambda G:lambda H:lambda I:lambda J:lambda K:lambda L:lambda f:lambda:f(A,B,C,D,E,F,G,H,I,J,K,L)
return F
return e
return d
return c
return b
@a("H")("E")("L")("L")("O")(chr(32))("W")("O")("R")("L")("D")("!")
def yeet(*args):print(*args,sep='\n')
yeet()

night quarryBOT
#

@floral meteor :x: Your 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 7, in e
004 | NameError: name 'F' is not defined
floral meteor
#

!e ```py
def a(A):
def b(B):
def c(C):
def d(D):
def e(E):
def f(F):
def g(G):
return lambda H:lambda I:lambda J:lambda K:lambda L:lambda f:lambda:f(A,B,C,D,E,F,G,H,I,J,K,L)
return F
return e
return d
return c
return b
@a("H")("E")("L")("L")("O")(chr(32))("W")("O")("R")("L")("D")("!")
def yeet(*args):print(*args,sep='\n')
yeet()

night quarryBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 14, in <module>
003 |   File "<string>", line 9, in e
004 | NameError: name 'F' is not defined
floral meteor
#

!e ```py
def a(A):
def b(B):
def c(C):
def d(D):
def e(E):
def f(F):
def g(G):
return lambda H:lambda I:lambda J:lambda K:lambda L:lambda z:lambda:z(A,B,C,D,E,F,G,H,I,J,K,L)
return g
return f
return e
return d
return c
return b
@a("H")("E")("L")("L")("O")(chr(32))("W")("O")("R")("L")("D")("!")
def yeet(*args):print(*args,sep='')
yeet()

night quarryBOT
#

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

HELLO WORLD!
floral meteor
#

boom

boreal slate
viscid nymph
#

!e

class E:
    def __eq__(self, other): return lambda: print("lol")
(E() == E())()
floral meteor
#

beat that for crazy

night quarryBOT
#

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

lol
floral meteor
#

should I fully expand it or introduce my bluetooth_headphones decorator?

#

!e ```py
def a(A):
def b(B):
def c(C):
def d(D):
def e(E):
def f(F):
def g(G):
def h(H):
def i(I):
def j(J):
def k(K):
def l(L):
def m(M):
def n():
return M(A, B, C, D, E, F, G, H, I, J, K, L)
return n
return m
return l
return k
return j
return i
return h
return g
return f
return e
return d
return c
return b
@a("H")("e")("l")("l")("o")(chr(32))("W")("o")("r")("l")("d")("!")
class O:init=lambda s,*t:s.setattr('t',t);eq=lambda s,o:print(*s.t,sep='')
O()==O

night quarryBOT
#

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

Hello World!
floral meteor
#

@viscid nymph I combined our ideas

viscid nymph
#

Oh wow lol

floral meteor
#

now I'll just work on your idea, but make it a little bit cursed, if you don't mind?

viscid nymph
#

Of course

floral meteor
#

There you go.

#

!e ```py
class O:eq=lambda s,o:print(*o,sep='')
O()=="Hello World!"
O()==['Hello',' ','World','!']

night quarryBOT
#

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

001 | Hello World!
002 | Hello World!
floral meteor
#

!e ```py
class stdout:le=lambda s,o:print(o,end='')
class sprintf:new=lambda c,*args,sep=' ',end='\n':sep.join(args)+end
stdout() <= sprintf("Hello","World",end='!')

night quarryBOT
#

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

Hello World!
floral meteor
#

there I think I'm satisfiied with it

#

It looks far more readable than print("Hello World",end='!', file=import('sys').stdout)

floral meteor
#

!e ```py
class stdout:le=lambda s,o:print(o,end='')
class sprintf:new=lambda c,s,*args,end='\n':s.format(*args)+end
stdout() <= sprintf("{} {}","Hello","World",end='!')

night quarryBOT
#

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

Hello World!
wanton tundra
#

this chat is fun as always

floral meteor
#

aye look what I did to that function's documentation

wanton tundra
#

wizardry

floral meteor
#

!e ```py
class BluetoothHeadphones:
def new(c,f):
f.doc="""Low Battery""".join([f.doc[i:i+(30-len('Low Battery'))]for i in range(0,len(f.doc),30)])+"Power off"if f.doc is not None and len(f.doc)>30 else f.doc
return f
class stdout:le=lambda s,o:print(o,end='')
@BluetoothHeadphones
def yeet(*args,**kwargs):
"""Actually just prints the stuffs, it's essentially the same as print, except it might run out of battery before it finishes. You gotta love technology ahahahahahaha"""
yield args;yield kwargs

stdout() <= yeet.doc

night quarryBOT
#

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

Actually just printLow Batterys, it's essentiallyLow Batterys print, except it Low Batteryut of battery beforLow Batteryes. You gotta love Low BatteryahahahahahahaPower off
floral meteor
#

there I used my favourite print function

#

you wanna see wizardry?

wanton tundra
#

i seen a lot of it in this channel

floral meteor
#

!e ```py
def self(n=0):
from sys import _getframe as e
f=lambda:None
f.code=e(n+1).f_code
return f
class stdout:le=lambda s,o:print(o,end='')
make_zero=lambda n:n and self()(n-1)
stdout() <= make_zero(8)

night quarryBOT
#

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

0
wanton tundra
#

this the type of stuff that doesnt even look like python code

hearty thicket
#

it's the way the language was meant to be written

floral meteor
#

!e ```py
def self(n=0):
from sys import _getframe as e
f=lambda:None
f.code=e(n+1).f_code
return f
class stdout:le=lambda s,o:print(o,end='')
make_empty=lambda a:a and self()(a[:-1])
s=stdout()
s <= make_empty("wheeeeeeee")
s <= make_empty([2,6,72,0,8,4,4])

#

yaha you can't print an empty string

wanton tundra
#

made this and was curious if its considered esoteric ?

Test = type("____", (), {"__init__": lambda self, **_: exec(f"for __, ___ in zip({_}.keys(), {_}.values()): setattr(self, __, ___)")})

number = Test(x = 5, y = 6)

print(number.x * number.y)
floral meteor
#

!e ```py
stdout=....class.class("echo",(),{'le' :lambda self, o:print(o,end='')})()
number=....class.class("_",(),{"init":lambda self,**:exec(f"for __, ___ in zip({}.keys(), {}.values()): setattr(self, __, ___)")})(x=5,y=6)
stdout <= number.x*number.y

night quarryBOT
#

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

30
floral meteor
#

that's the esotericer version

wanton tundra
#

love it

floral meteor
#

ty

#

actually i can make it even esoteric___er___

wanton tundra
floral meteor
#

there

floral meteor
#

!e ```py
s=....class.class("_",(....class.class("echo",(),{'le':lambda self,o:print(o,end='')}),),{"init":lambda self,**:exec(f"for __, ___ in zip({}.keys(), {}.values()): setattr(self, __, ___)")})(x=5,y=6)
s <= s.x*s.y

bold hearth
#

fr

night quarryBOT
#

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

30
wanton tundra
#

are you trying to compress it all into 1 line

bold hearth
#

prob

floral meteor
#

wdym trying?

#

if i wanted it all in one line i'd do this...

wanton tundra
#

sorry i ever doubted anything in this life

floral meteor
#

!e ```py
(s:=....class.class("_",(....class.class("echo",(),{'le':lambda self,o:print(o,end='')}),),{"init":lambda self,**:exec(f"for __, ___ in zip({}.keys(), {}.values()): setattr(self, __, ___)")})(x=5,y=6)) <= s.x*s.y

night quarryBOT
#

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

30
wanton tundra
#

nice :=

floral meteor
#

!e ```py
(s:=....class.class("_",(),{'le':lambda self,o:print(o,end=''),"init":lambda self,**:exec(f"for __, ___ in zip({}.keys(), {}.values()): setattr(self, __, ___)")})(x=5,y=6)) <= s.x*s.y

night quarryBOT
#

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

30
wanton tundra
#

and its golfing time

floral meteor
#

make it a little less long

#

you want me to golf it now?

wanton tundra
#

_>

floral meteor
#

!e ```py
print(30)

night quarryBOT
#

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

30
floral meteor
#

there

bold hearth
wanton tundra
#

lmao

#

i just saw you making it shorter and thought you were golfing

wanton tundra
bold hearth
#

i don't think so

floral meteor
#

nope

#

!e ```py
mul=lambda a,b:(s:=....class.class("_",(),{'le':lambda self,o:print(o),"init":lambda self,**:exec(f"for __, ___ in zip({}.keys(), {}.values()): setattr(self, __, ___)")})(x=a,y=b)) <= s.x*s.y
mul(5,6)
mul(3,10)
mul(20,21)

night quarryBOT
#

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

001 | 30
002 | 30
003 | 420
floral meteor
#

!e ```py
stdout=....class.class("stdout",(),{'le':lambda self,o:print(o,end='')})()
stdout <= "Hello "
stdout <= "World!"
stdout <= '\n'
stdout <= "XDDDDDDDDDDDDDDD\n"

night quarryBOT
#

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

001 | Hello World!
002 | XDDDDDDDDDDDDDDD
floral meteor
#

ellipsis and getattribute

neat verge
#

how can you get an attr from ellipsis?

neat verge
floral meteor
#

!e ```py
stdout=....class.class("stdout",(),{'le':lambda self,o:[lambda*d:lambda f:[(f:=e(f))for e in reversed(d)]][str()==()].call(print,lambda :.).call(....class.class(().str().class(),().class(),{'':o}))})()
stdout <= "Hello World!"
stdout <= "XDDDDDDDDDD"

night quarryBOT
#

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

001 | Hello World!
002 | XDDDDDDDDDD
neat verge
#

ohhhk, looks like im in my own /tableflip

floral meteor
#

yeah this is the esoteric channel

#

where code is deliberately made unreadable

neat verge
#

oh

#

im new to py

wanton tundra
#

and sometimes even worst

neat verge
#

just 3 monts in it

wanton tundra
floral meteor
#

I could walk you through, but don't ask what the ellipsis is supposed to be used for cos idk

neat verge
#

oh

floral meteor
#

!e print(...)

night quarryBOT
#

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

Ellipsis
floral meteor
#

see?

neat verge
#

yup

#

!e type(...)

night quarryBOT
#

@neat verge :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
#

!e print(dir(Ellipsis))

night quarryBOT
#

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

['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
neat verge
#

oh ok

floral meteor
#

that's all the attributes of ellipsis

wanton tundra
#
(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 _, __, ___, ____, _____, ______, _______, ________: _
        )
    )
)

btw any chance you remember/know who made this masterpiece a while ago ?

neat verge
#

Is this some kinf of easter egg in py, the ellipsis?

floral meteor
#

probably

floral meteor
#

yeah that's advanced python

neat verge
#

whop

#

I really am excited rn

floral meteor
#

so everything in python is actually either an object or an operator and an operator is just a shortcut to call an attribute of an object

neat verge
#

I still have Decorators and Async programming to learn and thats all I have left in Basic Py

wanton tundra
#

@neat verge run that code btw, result is fun for code complexity and size

neat verge
#

!e

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

@neat verge :white_check_mark: Your eval job has completed with return code 0.

Hello world!
neat verge
#

?

wanton tundra
#

i wouldnt say decorators and async are basic py, unless you talking about this channel standards

neat verge
#

wow

floral meteor
#

decorator essentially is a function that takes a function object and returns a slightly different function object

neat verge
wanton tundra
#

it uses decorators

neat verge
#

Also, I have a question in #discord.py pls help if you can

neat verge
neat verge
#

No idea what that does

#

but that @ is a decorator

floral meteor
#

!e In this channel, decorators are used for this:

@print
@lambda _:_.__doc__
class _:"""Hello World!"""
night quarryBOT
#

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

Hello World!
wanton tundra
#

huh

#

i never gave that tought, you can decorate builtins

neat verge
#

This is really so cool

wanton tundra
#

thats fun

neat verge
floral meteor
#

which is why this works:

stdout=....__class__.__class__("stdout",(),{'__le__':lambda self,o:[lambda*d:lambda f:[(f:=e(f))for e in reversed(d)]][str()==()].__call__(print,lambda _:_._).__call__(....__class__.__class__.__call__(().__str__().__class__(),().__class__(),{'_':o}))})()
stdout <= [lambda*d:lambda f:[(f:=e(f))for e in reversed(d)]][str()==()].__call__(print,lambda _:_._).__call__(....__class__.__class__(().__str__().__class__(),().__class__(),{'_':11*'%c'%(lambda*a:(*[+t+100for t in a],))(-28,--1,--8,--8,11,-68,-13,11,14,--8,+0)}))[0]
#

twice

neat verge
#

🤯