#python-discussion

1 messages Β· Page 506 of 1

inland karma
#

just how the word hacking become the word we use today

ashen cipher
#

i know the difference between parameter and argument it just takes cognitive effort to me to distinguish

ashen cipher
inland karma
ashen cipher
#

:p

chilly whale
#

right down to a single person going out of their way to correct the phrase "comprised of" on thousands of wikipedia articles, heh

charred tusk
#

Those Wikipedia editors are worse than Stack Overflow editors

cerulean ravine
#

there are so many examples of shifts if you've lived long enough to see them in action.

inland karma
#

arguments vs parameters the people that know the differences are exactly the people that are able to judge context to figure out what the content means

cerulean ravine
#

"reticent" used to mean "reluctant to speak" but now people are using it to mean reluctant.

inland karma
#

it means reluctant now.. i missed that

cerulean ravine
charred tusk
#

For example, the computer creates a "pick batch" to "pick" a "batch" of boxes from the warehouse.
So far so good.
Then for shipping, we scan the boxes, and print standard shipping labels in the SSCC format
https://en.wikipedia.org/wiki/Serial_shipping_container_code
But according to my shipping clerk, thats the "pick batch label"
No such label exists
The SSCC label doesn't reference the Pick Batch, its a whole different section of the system.
Clerk emailed support, support sent the email to me and said "we don't label Pick Batches..."

inland karma
#

ill try to keep that in mind... reluctantly πŸ˜„ πŸ˜„

#

oh well.. i tried

chilly whale
cerulean ravine
inland karma
chilly whale
#

I guess I'd have said it had a connotation of "shy", but I wouldn't have thought it was limited to speech

#

TIL

charred tusk
#

I've only ever heard that word like once
When I saw it my brain filled in "recant"
I apparently remember it as someone wanting to back away from something

ashen cipher
#

til reticent

inland karma
#

i was a very reticent young boy when i grew up.

#

norwegian has its own word for reticent and reluctant as wel, where you would use reticent more often

autumn forge
#

I always thought reticence meant emotional reservation

charred tusk
# charred tusk For example, the computer creates a "pick batch" to "pick" a "batch" of boxes fr...

Oh I actually have a perfect example relative to the above issue.
For some reason a box in inventory is called a "caselot".
When they come in, the receiving team prints the "blank goods label".
When they go out, the production team prints the "finished goods label".
They're both caselots in inventory, it would cost $0 to just consistently call them caselots and it would save tons of confusion for every new temp that thinks they're different.

#

Aside: my CEO calls both caselots and SSCC(s) "cartons" but that term doesn't actually exist on either entity, so that's yet ANOTHER term

#

I know it looks super nitpicky to make a big PR changing it all
But being clear helps so much

sand hornet
#

Starting to sound as bad as most big tech companies and their acronyms

charred tusk
#

Oh man, don't get me started, I won't stop...
There's a page where the same entity is referred to by three different names
Back when I was still bright eyed and bushy tailed I tried to make a glossary
By the end of the day I was crying

sand hornet
#

PBI
Power BI
Product Backlog Item

That's probably the most tame..

#

ML SEE
S.I.I.
(both referred to as "SEE", but one of the VPs wanted us to spell the acronym verbally)
All I know is that SII is Siri and Information Intelligence.. (this is actually on their jobs page, so I can repeat it)

And what makes it worse is that both used to be in the same org, under the same VP/SVP, and they only made ML SEE like half PMs and they really should've been PMs under SII..

errant snow
#

good evening!

pastel sluice
#

Howdy

terse mauve
#

hello

terse mauve
lucid hatch
#

Hello

pastel sluice
#

Hi

silver plover
gleaming knoll
#

TLA : TLA ~ girard's paradox

wicked comet
#

Hi

cerulean ravine
remote harness
#

guys how do i genuinly learn python, i have been trying for a month now

raw bramble
#

Clarity is key, I think that if parameters and arguments are different things, then the words should be used precicely to refer to those respective things

raw bramble
edgy krakenBOT
#
Go-to beginner resources

Here are the top free resources we recommend for people who are new to programming:

For a full, curated list of educational resources we recommend, please see our resources page!

remote harness
raw bramble
# edgy kraken

I recommend "Automate the Boring Stuff", it's a book designed to teach Python, and is suitable even if you have no programming experience whatsoever. You can read through it online for free at that link above

raw bramble
#

No problem, you can always ask any questions you want here. People here are really helpful

cerulean ravine
cerulean ravine
raw bramble
#

a keyword-only argument would be an argument with only keywords?

#

Maybe I'm not understanding what you're meaning

gleaming knoll
#

if i were to be really pedantic i would say that "keyword-only argument" does not make sense because a given argument is either passed positionally or by keyword, it does not make sense to say "only" since its just 1 thing which is one or the other
but that is if i interpret argument as 1 specific thing in a given call expression

raw bramble
#

I think some of those changes being made are overly verbose though, if it's easier and simpler while still providing the same amount of clarity then it should be done that way, but sometimes it needs to be clearer

cerulean ravine
cerulean ravine
velvet trout
unborn lagoon
dusk adder
velvet trout
#

Ooohhhh

gleaming knoll
finite sigil
#

Is there a way to switch python version in ubuntu ?
A simpler way
It already came installed with 3.14 for some reason

velvet trout
#

πŸπŸ’β›πŸ€– - A bot for backporting and merging CPython pull requests

So this is what it is

finite sigil
bronze dragon
#

It already came installed with 3.14 for some reason
because Ubuntu relies on Python for some of its functionality. which is why you don't mess with the system Python.

bronze dragon
velvet trout
#

You shouldn't mess with me
You don't wanna mess with me
'cuz if you're messing with me, you're messing with some of my functionality.

Lmao. Reminded me of that song

finite sigil
gleaming knoll
#

see resource usage in some process monitor
should probally have some cc or gcc whatever subprocesses that are compiling python
it shouldnt take too much time if pyenv calls make -j so its weird that it seems like its stuck

velvet trout
slow rivet
velvet trout
#

I like the match case way πŸ˜‹

#

and dislike that method one but really haven't actually used it in practice so kind of biased i am currently

rare gazelle
#

one annoying thing about match case is the double indentation

velvet trout
#

At least i don't have to spam isinstance() per if-elif stmt in same indentation, so i see it as a win situation

rare gazelle
#

to be fair its normally double indentation in all the languages i guess, now that i think about it
but in python indentation feels more important than in other langauages

#

(compared to switch case forexample, not a 1 to 1 comparison though)

velvet trout
#

indentations are cool 😎 even braces/delimiters based languages uses indentations to keep code more easy to catch on a level

bronze dragon
#

unfortunately we don't have that option πŸ™ƒ

rare gazelle
smoky onyx
#

although this is not a chit chatting server
i am stressed and i want to chit chat among intellectual beings
hi

rare gazelle
bronze dragon
#

I do think the indented nature of Python prevents us from better syntax in certain cases
like full-powered lambdas, or match-case as expression like Rust has

smoky onyx
#

has anyone studied TAFL it is such a useless subject my brain is nt braining

dry pike
#

also just because we know programming doesn't make us intellectual :)

velvet trout
bronze dragon
smoky onyx
rare gazelle
bronze dragon
#

what

rare gazelle
#

i'm not a match case expert, since i dont use it often

smoky onyx
steady rain
velvet trout
# rare gazelle πŸ€” mind sharing some code

i was editing it so it had some stuff that shouldn't be there to show you so i deleted unnecessary fluff and now presenting you clean one:

def parse(tokens: Iterable[ArgumentToken], command: Command) -> CommandNode:
    node = CommandNode(command)
    token_stream = TokenStream(tokens)

    context = ParseContext(
        node=node,
        token_stream=token_stream,
    )

    while (token := token_stream.peek()) is not None:
        match token:
            case OptionToken(prefix=prefix):
                token_stream.consume()
                match prefix:
                    case OptionPrefix.LONG:
                        _handle_long_option(token, context)
                    case OptionPrefix.SHORT:
                        _handle_short_option(token, context)
                    case _:
                        assert_never(prefix)
            case ShortOptionGroupToken():
                _handle_short_option_group(token, context)
            case ArgumentToken():
                parse_mode = context.node.command.parse_mode
                match parse_mode:
                    case ParseMode.COMMAND:
                        token_stream.consume()
                        _handle_command(token, context)
                    case ParseMode.OPERAND:
                        _handle_operand(token, context)
                    case _:
                        assert_never(parse_mode)
            case ArgumentToken():
                raise AssertionError(f"did not expect an {type(token).__name__!r} token")
            case _:
                assert_never(token)

    _validate_command_node(node)

    return node
bronze dragon
smoky onyx
rare gazelle
velvet trout
bronze dragon
#

wdym

velvet trout
#

Idk if that's really appropriate

smoky onyx
steady rain
bronze dragon
velvet trout
smoky onyx
smoky onyx
bronze dragon
# smoky onyx which branch is that 😭

systems programming deals with the operating system itself. this is at various levels, from drivers to core OS processes and tools like init systems and daemons and so on.

smoky onyx
bronze dragon
#

yeah, CS major in university.

smoky onyx
#

nice

#

so how tafl helped u

velvet trout
bronze dragon
rare gazelle
smoky onyx
#

it is just an extra subject like it is for ece students 😭

velvet trout
velvet trout
#

i think i have read somewhere about .kind = EnumMember

#

Maybe that's more easy for statically typing

rugged barn
#

🫠

bronze dragon
rare gazelle
#

you have case ArgumentToken(): twice, only the first one could get triggered

cerulean ravine
velvet trout
#

Well its wrong, because i am still editing

rare gazelle
#

its pretty clever

velvet trout
#

Or prefix attr

bronze dragon
velvet trout
#

And assigns to name at right side

rare gazelle
#

instead of doing prefix = token.prefix afterwards

velvet trout
#

ClassName(attrname=varname)

rare gazelle
#

you say it needs to be an OptionToken with a prefix attribute, and you store that attribute in prefix

cerulean ravine
velvet trout
#

Yeah

rare gazelle
#
case OptionToken():
    prefix = token.prefix

is the same as:

case OptionToken(prefix=prefix):
#

thats a nice trick

velvet trout
#

guess so

#

In Python, we cannot statically know all subclasses of a class but at runtime we can (as far as those subclasses were found and evaluated)?

rare gazelle
#

i mean, unless there's OptionToken without a prefix attribute, then its not the same

velvet trout
#

OptionToken does have a prefix, that is why we have another match case for it

rare gazelle
#

say you had ones with and ones without, only those with would get matched

#

but in:

case OptionToken():
    prefix = token.prefix

all would get matched

#

thats a small technicality though

#

actually

#

prefix = token.prefix would error

velvet trout
#

imagine OptionToken() but one doesn't have a prefix and goes down and ends up in assert_never lol

rare gazelle
#

lol

#

lambda shared in here a code with many match cases and i found it interesting...

velvet trout
#

Share me that too :D

rare gazelle
#

let me see if i can find it, i barely understood anything though not gonna lie

velvet trout
#

Tho i wished i had more stuff to add more cases, this one is barely 3 cases

velvet trout
#

oh :_(

rare gazelle
#

you definitely won't find interesting match case usages in my codes though, since i really barely use match case haha... mainly because of the double indentation

velvet trout
#

I think i will change this into Token.kind where kind is closed end enum and use that in cases instead of token classes

hybrid nebula
#

is there any reason we're not resampling audio by doing a FFT and zero-padding/trimming the frequency array, then performing reverse FFT?

rare gazelle
#

umm, you can i guess

#

although if you use match case for constants you kind of not fully utilizing its power for pattern matching

velvet trout
gleaming knoll
rare gazelle
velvet trout
rare gazelle
#

but if you want, you can share a link for it, it was an interesting read

#

basically the usage of match case you did there...

gleaming knoll
#

oh and i did a | with a symmetric pattern to make the order not matter

rare gazelle
#

(the link is dead)

gleaming knoll
#

yeah ik

rare gazelle
gleaming knoll
#

idk if its actually good lol
its kinda ass

rare gazelle
#

could be nice if you could store patterns in variables

gleaming knoll
#

FIRST. CLASS. PATTERNS.
pattern calculus

crisp jay
#

huh discord is changing the markdown colors

gleaming knoll
#

there is a problem with how to use that when patterns capture variables though
its not exactly obvious

rare gazelle
#

why not

#

you basically store the actions

gleaming knoll
# rare gazelle why not

how would a function that matches against an arbitrary pattern know what are the variables it gets from the pattern?

rare gazelle
#

the actions will get executed there

gleaming knoll
steel whale
rare gazelle
#
def unify(lhs, rhs):
  match (lhs, rhs):
    case (Variable(name), expr) | (expr, Variable(name)):
      return {name: expr}
    ...

to

pattern x = (Variable(name), expr) | (expr, Variable(name))
def unify(lhs, rhs):
  match (lhs, rhs):
    case x:
      return {name: expr}
    ...
gleaming knoll
velvet trout
#

Be explicit

#

!zen explicit

edgy krakenBOT
#
The Zen of Python (line 1):

Explicit is better than implicit.

steel whale
#

what were you asking about then sweetheart

velvet trout
#

Your pfps matches color slightly making me think its the same person

steel whale
#

same aesthetic

#

not same person

velvet trout
#

Yeah correct term

gleaming knoll
# rare gazelle what you mean

first class patterns would be analogous to first class functions
like being able to pass a function to map or filter, you would pass a pattern to some function, or store it in a collection

rare gazelle
#

i still dont understand what you mean

rare gazelle
#

thats the thing

gleaming knoll
hybrid nebula
rare gazelle
#
pattern x = (Variable(name), expr) | (expr, Variable(name))
def unify(patt, lhs, rhs):
  match (lhs, rhs):
    case patt:
      return {name: expr}
    ...

unify(x, lhs, rhs)
gleaming knoll
#

and how do you know that patt binds name and expr?

rare gazelle
#

thats what the function wants

gleaming knoll
#

that doesnt play out nice with how scope resolution works in python

#

it also means patterns have to match in names and that doesnt compose well
basically unhygienic macros

steel whale
#

We don’t have the same aesthetic at all. Just two black and white pics weirdo.

  • @neat locust

no need to be rude about it, it's just profile pictures

gleaming knoll
#

the "usual" solution (this is not even a topic that is talked about much in PL) would be to make them actually analogous to functions, have them return values

rare gazelle
gleaming knoll
hybrid nebula
gleaming knoll
#

you can already do "first class patterns" in a really stupid way with stuff like that yeah

steel whale
#

ghost ping?

charred tusk
#

@steel whale

#

Found a ping

gleaming knoll
# steel whale ghost ping?

they deleted the message
the person who you pinged said something "i dont know you, dont mention me"
such a weirdo idk

steel whale
charred tusk
steel whale
hybrid nebula
#

fun fact:

try: a, b = val; except: return False

has different behaviour from

ab = list(val)
if len(ab) != 2: return False
a, b = ab
gleaming knoll
#

i mean thats obvious, the second doesnt check that it can list the val

charred tusk
rare gazelle
hybrid nebula
#

wdym?

gleaming knoll
# hybrid nebula ?

in the first one, the except will catch the case where val isnt iterable

rare gazelle
#

i haven't tried your code, just assuming

hybrid nebula
#

the second one has different behaviour even if you wrap it in try/except return false

rare gazelle
#

i assume that a could have a value even if it errors

#

if its 1 element size in val

#

its the same sht as that tuple example, mentioned in here from time to time

hybrid nebula
#

at least not if it throws an error

gleaming knoll
#

UNPACK_SEQUENCE fully happens before the assignments are started to execute

hybrid nebula
#

what I was specifically referring to was that in case 1, there are never more than 3 items generated before erroring

#

in the second case, if the iterator never halts... fun

rare gazelle
#

if its an infinite iterator it would get stuck in the first one as well i think

gleaming knoll
hybrid nebula
rare gazelle
#

interesting

hybrid nebula
#

I wonder whether the expression of the yield is evaluated... should be if you think about bytecode

rare gazelle
#

so it errors as well but at the third yield, interesting to know

granite wyvern
hybrid nebula
granite wyvern
#

It must be.

rare gazelle
#

what you mean cameron

gleaming knoll
rare gazelle
#

if its an iterator in order to know if its size is 2 u need to yield 3 times at least

granite wyvern
proud mica
#

guys im going to learn phyton , what advice would you give me?

cerulean ravine
cerulean ravine
hybrid nebula
rare gazelle
#
def x():
    cnt = 0
    
    while True:
        yield cnt
        print(f"yielded {cnt}")
        cnt += 1

try:
    a, b = x()
except:
    ...
#
yielded 0
yielded 1

doesn't get to print yielded 2

proud mica
rare gazelle
#

so at yielded 2 it errors

cerulean ravine
hybrid nebula
proud mica
cerulean ravine
hybrid nebula
#

while model providers do not yet charge the cost they would need to break even

velvet trout
velvet trout
velvet trout
#

Also i decided on terms for my cliargparse.

class Tokenizer.tokenize(source: str) -> lexemes: list[str]

lexer.lex(lexemes) -> Generator[Token]

class Token.lexeme: str

#

previously i was using "argument(s)" as a term vaguely everywhere

rare gazelle
#

you mean documentation?

gleaming knoll
#
a, b = iterable
# ~
_N = 2
if isinstance(iterable, (list, tuple, dict)):
  _size = len(iterable)
  if _size > _N:
    raise ValueError(f"too many values to unpack (expected {_N}, got {_size})")
try:
  _iterator = iter(iterable)
except TypeError:
  raise TypeError(f"cannot unpack non-iterable {type(iterable).__name__} object")
_values = []
for _ in range(_N):
  try:
    _values.append(next(_iterator))
  except StopIteration:
    raise ValueError(f"not enough values to unpack (expected {_N}, got {len(_values)})")
try:
  next(_iterator)
except StopIteration:
  pass
else:
  raise ValueError(f"too many values to unpack (expected {_N})")
assert len(_values) == _N
a = _values[0]
b = _values[1]
velvet trout
rare gazelle
rare gazelle
#

unpack a,b from infinite iterator

gleaming knoll
#

that does it, it only nexts 2+1 times

rare gazelle
#

ie: 0,1,2,3,4,5..... unpacked: 0,1

#

using the syntax of a,b=x

#

i dont know if its possible

gleaming knoll
#
def take_first_two(iterable):
  iterator = iter(iterable)
  yield next(iterator)
  yield next(iterator)
a, b = take_first_two(x)

(islice or whatever)

rare gazelle
#

it must bbe an infinite iterator, but you can have helpers

gleaming knoll
#
def first(n, it):
  it = iter(it)
  for _ in range(n):
    yield next(it)
a, b = first(2, x)
rare gazelle
#

first(2,x) isn't infinite

gleaming knoll
#

then its impossible, the unpacking mechanism itself will error if the rhs is longer than 2, no matter what you do to the iterable

rare gazelle
#

i dont know if its impossible, maybe though

velvet trout
#

Why make life hard? ducky_concerned

rare gazelle
#

what if you try except the yield in a function?

granite wyvern
# rare gazelle ```py def x(): cnt = 0 while True: yield cnt print(...

This tests that the yield happened and control came becak to the generator. That second part oesn't necessarily happen.

I think the yield happened (you could yield from a function which prints to check) and that Python's mechanics then blow the a,b assignment, which will raise GeneratorStop (?) inside the generator, terminating it.

velvet trout
#

GeneratorExit you mean?

gleaming knoll
granite wyvern
#

So put:

try:
    yield x
except:
    print("generator raised from yield", sys.exc_info())
    return
rare gazelle
#

if you could somehow knokw what is trying to get unpacked, whats the expected size, if there's a determined size

rare gazelle
#

from what i understood, the third yield raised an error outside

#

it did try to yield the third item, but errored

granite wyvern
# rare gazelle not sure i understand what you're saying

You were asserting that the lack of the third print meant the yield didn't occur. But yield is a 2 step process - the value goes out to whoever is calling next() and a value or exception comes back when the generator resumes, at the next next() or throw or send.

Let me make a demo.

rare gazelle
#

trying the yield wouldn't help though

#

because the error happens outside

chilly whale
#

the error happens in both places

rare gazelle
#

there was an attempt to yield the 3rd item

#

which lead to the error outside

gleaming knoll
rare gazelle
#

i dont know how the internals of it work, but could be

chilly whale
#

!e See for instance: ```py
import itertools
counter = itertools.count()
print(next(counter))
try:
a, b = counter
except Exception:
pass
print(next(counter))

edgy krakenBOT
granite wyvern
# rare gazelle it did try to yield the third item, but errored
[~/tmp/disco/mtnjustme]fleet2*1> py3 yield3.py
+ exec python3 yield3.py
about to a,b=gen()
gen: start
gen: about to yield 0
gen: after yield, about to bump n
gen: about to yield 1
gen: after yield, about to bump n
gen: about to yield 2
gen: yield raised exception (<class 'GeneratorExit'>, GeneratorExit(), <traceback object at 0x1091229c0>)
Traceback (most recent call last):
  File "/Users/cameron/tmp/disco/mtnjustme/yield3.py", line 19, in <module>
    a,b=gen()
    ^^^
ValueError: too many values to unpack (expected 2)
[~/tmp/disco/mtnjustme]fleet2*1>
chilly whale
granite wyvern
#

This is from this code:

import sys

def gen():
  print("gen: start")
  n = 0
  while True:
    print("gen: about to yield", n)
    try:
      yield n
    except:
      print("gen: yield raised exception", sys.exc_info())
      return
    print("gen: after yield, about to bump n")
    n += 1

print("about to a,b=gen()")
a,b=gen()
chilly whale
#

the only way that unpacking could know that the iterator wasn't exhausted is by asking for a 3rd value and seeing whether or not it gets a StopIteration. And once it has asked for that 3rd value, there's no way to put it back - it's already been yielded

granite wyvern
#

The purpose of my example, vs GG's, is to show control returning to the generator.

rare gazelle
#

that is expected though

rare gazelle
#

why did yield errored inside?

#

it yielded successfully

granite wyvern
sand hornet
terse mauve
sand hornet
rare gazelle
#

if you know that, you know exactly how many values to yield

chilly whale
rare gazelle
#

of course it's not always known, but it's sometimes known

chilly whale
rare gazelle
#

a,b u know that there are 2 arguments to get packed

sand hornet
#

Finally got Discord's light theme to kinda work for me ✨

granite wyvern
#

This kind of flow, btw, is how async works: a coroutine which awaits yields, so that the event loop can run. The coroutine is resumed by the event loop by by passing a value (the await result) or exception back to the coroutine from the event loop.

These mechanics are hidden by the async/await keyword mechanism.

But async is cooperating generators.

rare gazelle
granite wyvern
rare gazelle
#

so you can know from inside the generator if an exception happened outside

chilly whale
granite wyvern
rare gazelle
sand hornet
# granite wyvern This kind of flow, btw, is how async works: a coroutine which awaits yields, so ...

Or like a main thread has to have either a semaphore or a mutex in order to interact with the async thread. Once incremented or decremented (usually decremented), then the main thread can continue.

  • create mutex
  • Start async thread with mutex pointer
  • wait for the mutex to update
  • async thread runs
  • async thread updates mutex
  • async thread exits, and the main thread continues as condition check is now passed
    (Sorry, I've been writing a lot of concurrent Swift lately)
gleaming knoll
# rare gazelle yea not always, but sometimes

if the call to gen is at the line of the unpack you can just

import sys
import linecache

def gen():
  frame = sys._getframe(1)
  context = linecache.getline(frame.f_code.co_filename, frame.f_lineno)
  target_vars = context.partition("=")[0].split(",")
  amount = len(target_vars)
  return range(amount)

a, b = gen()
print(a, b)
gleaming knoll
rare gazelle
#

notice that the error tells you the amount btw

#

trying to unpack 3 to 2 iirc (so that information is stored somewhere)

gleaming knoll
granite wyvern
#

Just above that is generator.send(value) which is how the value of the yield expression is received.

charred tusk
#

I just wanna say
God bless platformdirs

rare gazelle
#

too many values to unpack (expected 2)

#

so expected 2 that information is stored somewhere

#

if you could get that information beforehand, you could islice the iterable and return it

granite wyvern
#

Yes, but you don't know the generator made too many values without triggering the final yield. And python raises the too many values exception.

rare gazelle
sand hornet
gleaming knoll
rare gazelle
#

on an error that occurs outside, sending GeneratorExit

granite wyvern
#

You could hold onto the generator though and defer the gc.

rare gazelle
#

that makes sense i guess

gleaming knoll
#

actually i recently had an idea about making a language that would compile directly to cpython bytecode

#

and i wanted to play around with compiling to match expressions

rare gazelle
gleaming knoll
gleaming knoll
# rare gazelle whats the benefit in that

"native" (to the python interpreter) implementation of a match expression (which my language would have because based functional programming everything is an expression)

rare gazelle
#

πŸ€”

#

second time today someone mentioned match expression

gleaming knoll
#

i also want to learn how to implement lazy evaluation in languages

chilly whale
#

given that Python's bytecode format isn't stable, it'd probably be a better idea to transpile to Python and then compile the Python to bytecode instead of compiling directly to bytecode. Way less maintenance

cerulean rune
#

Thanks a lot for the help with improving my code. Your guidance made it easier to understand what I was doing wrong. I was able to fix my errors and clean things up properly. I appreciate you taking the time to help me make my code better.

gleaming knoll
soft coral
gleaming knoll
#

changes version to version. its not os dependent, that would defeat the purpose of bytecode, the purpose is to abstract from this detail and run anywhere

soft coral
#

Ah

soft coral
#

Oh

chilly whale
rare gazelle
gleaming knoll
chilly whale
#

endianness, integer size, etc

rare gazelle
unborn lagoon
gleaming knoll
# rare gazelle this correct right^

i would just need to change the code in the parts that match jumps to. its just that normally its code that doesnt have a stack effect because its compiled from a block of statements, but the match instructions themselves are just control flow

chilly whale
#

perhaps I'm wrong then. Someone recently mentioned to me that the bytecode format is arch dependent in recent versions, but perhaps I misunderstood them

rare gazelle
#

why specifically you want to go with python bytecode if you want functional

#

wouldn't it make sense to use something rust uses for example

gleaming knoll
rare gazelle
#

or even haskell

gleaming knoll
rare gazelle
#

uh

#

well good luck i guess, would be interesting to try it

lunar cobalt
#

If I have aliases for something, say types (Where Nat is also natural) should I loop through every type to check if that's a type's alias or have a reverse lookup dict?

gleaming knoll
frosty oriole
#

we need more context

lunar cobalt
gleaming knoll
#

i dont understand why are you calling this "reverse"

lunar cobalt
#

Because the "actual" lookup would be from Nat to natural, checking if natural is one of its aliases?

#

Instead the lookup is reversed, getting the actual type directly from the alias

gleaming knoll
#

why would you do that

lunar cobalt
#

Nat -> natural is normal
natural -> Nat is reverse

lunar cobalt
gleaming knoll
#

it does not make sense to have a {Nat: natural} mapping if natural resolves to Nat. you'd have {natural: Nat}, and this would be ~let b : Nat = 6 after resolving aliases

#

if your type aliases are simple then typealias A = B should just be type_table["A"] = evaluate_type_expression("B")
and if you have parametrized aliases you handle them similarly to functions
because well really they are, type aliases are just variables for types, and parametrized type aliases are (restricted) functions on types
problems only appear with recursive type aliases

cerulean ravine
#

is this going to be a long discussion about a language other than Python?

gleaming knoll
#

this is just a general language implementation discussion. python has type A = B

crisp jay
#

does python have/had a function/builtin that has a name A that does everything but A

gleaming knoll
#

a name that doesnt at all describe what the function does?

crisp jay
gleaming knoll
#

no, what you said makes sense, its just that A has to be treated as a variable representing some identifier

cerulean ravine
gleaming knoll
#

would "anything but A" avoid that problem? since its kinda referring to 1 thing, not "every"
since "everything but A" is a figure of speech i dont treat the "everything" in it literally, i just infer from context, so i didnt mind it

gleaming knoll
manic flare
#

β€œBut doesn’t do A” would be more appropriate

raw bramble
#

How would !x work if x is a ternary data type rather than a boolean?

rare gazelle
gleaming knoll
gleaming knoll
rare gazelle
raw bramble
manic flare
raw bramble
gleaming knoll
brisk gazelle
gleaming knoll
# gleaming knoll 1, 0, -1

unfortunately in this case !0 = 0
if you dont want that, then cycle the states (in either direction) rather than reversing the entire sequence

raw bramble
#

What's the word for these 2 types of ternary I forgotr

#

There's the one where it's balanced with -1, 0, and 1. then the other one which is 0, 1, and 2

gleaming knoll
#

(un)balanced

raw bramble
#

yeah thy

gleaming knoll
brisk gazelle
#

Ah, it's __invert__.

#

~

manic flare
#

Does anyone else ever wish that
my_list = [1, 2, 3]
print(my_list[4])
would print 2?

gleaming knoll
#

implicit wraparound? no, i dont wish that, it would be a common source of bugs

jagged belfry
#

!e ```py
a = [1, 2, 3]
print(a[-5])

edgy krakenBOT
# jagged belfry !e ```py a = [1, 2, 3] print(a[-5]) ```

:x: Your 3.14 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 2, in <module>
003 |     print(a[-5])
004 |           ~^^^^
005 | IndexError: list index out of range
gleaming knoll
#

i can always just do seq[idx%len(seq)] if i want wraparound in some specific place
or do seq = Circular(seq) if its going to be circularly indexed in a lot of places

terse mauve
gleaming knoll
#

i dont think there is one in stdlib. i've written my own a couple of times, you basically just do this % thing in all the methods related to indexing

terse mauve
cerulean ravine
gleaming knoll
#

a[b] is __getitem__

terse mauve
#

__getitem__

gleaming knoll
terse mauve
#

sorry, too much rust and python lately

cerulean ravine
lunar cobalt
#

Are functions without recursion just text replacement basically?

gleaming knoll
lunar cobalt
#

Without the fact that variables are scoped

gleaming knoll
lunar cobalt
cerulean ravine
terse mauve
cerulean ravine
cerulean ravine
lunar cobalt
#

mhh i see

gleaming knoll
#

an indepth explanation of inlining would explain the differences from textual replacement,
when its applicable and when not
its an interesting topic

charred tusk
#

Ned I need an opinion
I'm bikeshedding Claude's suggestion instead of just moving on

gleaming knoll
charred tusk
#

Claude gave me these cache keys

def _licensing_key(design_code: str) -> str:
    return f"{KERP_NAMESPACE}:art:licensing:" + json.dumps([design_code])


def _print_records_key(design_code: str, ground_color: str, gender: str) -> str:
    return f"{KERP_NAMESPACE}:art:print_records:" + json.dumps(
        [design_code, ground_color, gender],
    )

I don't like the lists, I don't really wanna be using JSON here at all
I feel like the first should just be raw and the second should just use something simpler like commas

jagged belfry
#

oh god why

cerulean ravine
granite wyvern
jagged belfry
#

hash(json.dumps(code))

#

not literalyl hash()

#

put a sha512 in there or something

#

This is why I hate ai btw

granite wyvern
crisp jay
cerulean ravine
charred tusk
pastel sluice
#

It's only just now hitting me that training these models on so much publicly available code will yield those kinds of results, because genuinely good code is hard to find

crisp jay
jagged belfry
#
def cache_key_for(keyspace: str, **key_args) -> str:
    return f"{KERP_NAMESPACE}:{keyspace}:" + hashlib.sha256(json.dumps(dict(sorted(key_args.items()))).hexdigest()
charred tusk
#

woah

cerulean ravine
jagged belfry
cerulean ravine
granite wyvern
cerulean ravine
pastel sluice
#

actually, I don't even think any "explanation" you'd get from Claude would be a record of any actual process of reasoning on its part, but a post-hoc rationalization

charred tusk
# cerulean ravine and?

Good catch β€” there's no functional reason for the list around a single value. I used json.dumps([design_code]) for both keys to keep one consistent encoding shape (so both helpers look symmetric and you never have to think about whether a key has one or many components), but for the licensing key that just produces noise like ["DESIGN1"] instead of "DESIGN1".

A few alternatives, in increasing tidiness:

  1. Drop the list for licensing and just use json.dumps(design_code) β†’ key becomes kerp:art:licensing:"DESIGN1". Quotes still come along because JSON, but it's at least scalar.
  2. Skip JSON entirely for the single-value case β†’ f"kerp:art:licensing:{design_code}". Simplest, readable, but you do need to trust the input doesn't contain : or other separators (design codes here look safe).
  3. Keep json.dumps([...]) for both. The only real argument for it is "every key value is a JSON array of its parameters," which is mildly nice for debuggability of multi-arg keys (print_records), but it adds zero value for licensing.

If you want, I can change the licensing key to option 1 or 2. Note this would invalidate any already-cached kerp:art:licensing:[...] rows on existing machines, so users would see a one-time miss after the change (a untw cache clear --namespace kerp --yes would also do it cleanly).

Continued with Autopilot: Task not yet complete
Answered the user's question about why the licensing cache key wraps the single design code in a JSON list, explained it's just for symmetry with the multi-arg print_records key, and offered three cleanup options.

spice hill
jagged belfry
#

Oh, right

charred tusk
#

Which isn't a problem in my case
But still overcomplicated

cerulean ravine
jagged belfry
#

fixed.

spice hill
cerulean ravine
jagged belfry
#

There are a dozen problems with these cache keys:

  • you're packing in complex formats
  • they're big
  • they're unbounded
  • your generate function is insufficiently modular
  • your generate function can't take in any parameters besides a str (???)
cerulean ravine
jagged belfry
#

There's no reason you can't just *args that instead of having several functions

charred tusk
#

pithink that could also work

gleaming knoll
#

do you ever go looking at your cache

jagged belfry
#

no

cerulean ravine
#

readable cache keys can be very nice.

jagged belfry
#

I typically purge it before doing that

spice hill
charred tusk
#

It doesn't, the computer is handling all caching
But there's no reason to go create some bespoke format instead of a 20 character strings

jagged belfry
#

If you want readable keys you can just ":".join()

charred tusk
spice hill
granite wyvern
cerulean ravine
charred tusk
#

For a CLI tool

jagged belfry
#
def cache_key(*keycodes: str):
  return KERP_NAMESPACE + ":" + ":".join(str(i) for i in keycodes)

def licensing_key(design_code: str):
  return cache_key("art", "licensing", design_code)

wraith wolf
#

hey is anyone here a reverse engineer

charred tusk
#

Sure, why not

spice hill
#

cache for what though? what are the values?

charred tusk
frosty oriole
#

and your inputs are the parameters to the API call?

cerulean ravine
#
def cache_key(*keycodes: str):
    return ":".join([KERP_NAMESPACE, *keycodes])
spice hill
# charred tusk API responses
print_record_response_cache:
design_code,ground_color,gender,response
``` then make an index on `design_code,ground_color,gender`
bright shoal
jagged belfry
#

Yeah, that is better, thanks

frosty oriole
#

you're trying to cache it so that if you call the same inputs for the API you get a cached response?

granite wyvern
#

I'm working on a project which does such a cache also. It's one table. (Well, no, 2 tables: entities and tags for them.)

My cdrip script uses this for the musicbrainzng cached responses for example.

charred tusk
#

And... I just submitted something needing redaction to the pastebin

#

based

wraith wolf
spice hill
#

I'd be worried about the codes containing :. You never know what's coming. Maybe you could percent-encode them or something

frosty oriole
#

go put up a post on linked or something

charred tusk
frosty oriole
#

no reverse engineer worth their salt is on fiverr

spice hill
granite wyvern
edgy krakenBOT
#

9. Do not offer or ask for paid work of any kind.

charred tusk
#

fair

bright shoal
wraith wolf
charred tusk
bright shoal
#

πŸ€”

spice hill
jagged belfry
#

I hate ai code

gleaming knoll
charred tusk
gleaming knoll
#

absolute cinema

gleaming knoll
#

lmao

robust ledge
charred tusk
#

IDK, kinda wanna meet them and see what they're like one day

granite wyvern
robust ledge
#

I'm impressed at you even remembering that repo. I'd forgotten about it.

charred tusk
# cerulean ravine what did you think of the options it offered?

I'm not sure
I've never done this before -- hence me asking Claude to show me an implementation
My brain wants option 1, no need for a list if there's only one value
But I can get behind the consistency of just always using a list to keep everything uniform

charred tusk
cerulean ravine
charred tusk
#

Yeah my code often sparks... very heated discussions 😳

spice hill
charred tusk
#

The code or the reply?

spice hill
#

code

charred tusk
#

no

spice hill
#

would be funny if you wrote the code by hand but than offloaded the discording to claude

charred tusk
#

new project idea unlocked

#

I asked Claude for an example implementation because I have never done SQLite caches before
I started doing some copy-editing and got stuck bikeshedding

spice hill
charred tusk
#

~25k

spice hill
#

And how many kilobytes/megabytes of values per entry?

#

actually, maybe this doesn't matter

charred tusk
#

If you wanna see how dangerous it is when I'm left to do these things myself:

pos = _parse_pos_csv()
for po_number, items in pos:
  if Path(f"pos/{po_number}-request.xml").exists():
    print(f"Skipping PO {po_number} because request XML already exists.")  # noqa: T201
    continue
  pre_po = build_purchase_order(po_number, items)
  po = build_purchase_order_request(client, pre_po)
  client.service.sendPO(SanMar.promostandards_ws_version, SanMar.username, SanMar.password, po)
  Path(f"pos/{po_number}-request.xml").write_text(client.last_sent().str())
  Path(f"pos/{po_number}-response.xml").write_text(client.last_received().str())
  print(f"Processed PO {po_number}")  # noqa: T201
  sleep(2)  # Sleep to avoid overwhelming the server
spice hill
# charred tusk ~25k

Why do you want to have the namespace as part of the key and not separate column? That sounds like a holdover from Redis or something like that

#

See how many things would be simplified if there was a namespace column

#
    def count(self, namespace: str | None = None) -> int:
        """Return the number of stored entries, optionally filtered by namespace."""
        with self._connect() as connection:
            if namespace is None:
                row = connection.execute("SELECT COUNT(*) FROM cache_entries;").fetchone()
            else:
                like = namespace + NAMESPACE_SEPARATOR + "%"
                row = connection.execute(
                    "SELECT COUNT(*) FROM cache_entries WHERE key LIKE ?;",
                    (like,),
                ).fetchone()
        return int(row[0]) if row else 0
``` I'm certain that this method is O(N) where N is the number of all entries. I wouldn't expect a full table scan to count how many entries there are in a namespace
charred tusk
#

I thought thats what indexes were for
It already has all the keys sorted so it can jump to right where it needs to
But IDK databases very well

frosty oriole
#

O(N) is worst case but if cache entries is indexed its faster im pretty sure

charred tusk
#

not yet

frosty oriole
#

you should

timid ember
#

Index make faster

spice hill
#

i honestly don't know any good resources for this topic, i've been looking for some myself

charred tusk
#

caching or indexing?

timid ember
#

how would you cache a database

spice hill
grim axle
charred tusk
#

I actually wanna change that
Claude put .db but I prefer being more expli.....
Oh Claude was smart
CACHE_DB_FILENAME = "cache.sqlite3"

grim axle
#

we using AI now ducky_concerned

charred tusk
#

IDK why .db is such a big thing
I also don't know why I care

charred tusk
#

I just clicked this button and it turned red and now VSC is doing something completely different than it was five minutes ago

velvet trout
#

This server's members shames AI while at the same time also uses AI

Hypocrisy! xD (i am just kidding)

charred tusk
#

Everyone having their own opinions isn't hypocritical

velvet trout
#

Just ironic to me sometimes

cerulean ravine
spice hill
#

there are different people in this server, we are not a hivemind

charred tusk
#

yet

cerulean ravine
#

"we are not a hivemind... we are not a hivemind..."

gleaming knoll
velvet trout
cerulean ravine
grim axle
# charred tusk IDK why .`db` is such a big thing I also don't know why I care

after reading this "bikeshedding" debate; and with consideration of AI (Claude Code)-
I think that you should plan your approach a bit more.

think how you would want to interact with the code, and get more familiar with the abilities of SQL .
having a working demo would help.

don't let AI decide regarding structure and (key) design aspects.

before you know it, you'd be chained to a workflow you don't like; and forced to work with functions with half assed behaviors.

tldr; learn your stuff, and decide for yourself.
only then, if you must, face AI to assist you.

#

personal project just need to work, and be fairly manageable. (not AI bs)

gleaming knoll
lost lagoon
#

I use AI as autocorrect for code.....

velvet trout
#

Does that mean i can write a parser for humour without ambiguity? Yay!

#

I use three AIs to debate upon which term/word is recommended and more faithful to its task.

grim axle
# harsh anchor why is it funny?

why cache a (local) database, if you already have said database.

unless some repeated heavy queries are made, local db calls are rather fast.

charred tusk
#

PG has built in caching
Not sure if SQLite does too

harsh anchor
modern hinge
#

is it a good practice to use literal unpacking?
like instead of doing range(1, 10) several times or py min = 1 max = 10 range(min, max) ...
doing py x = (1, 10) range(*x)

charred tusk
velvet trout
#

overshadowing built-in min & max ? ducky_concerned

charred tusk
#

πŸ”₯

grim axle
# lost lagoon I use AI as autocorrect for code.....

its best to have it criticize your code; auto correcting from the getgo usually breaks design intentions.

plan it (maybe with AI), only then implement it. otherwise it likes to hallucinate decisions and limitations.

dry pike
robust ledge
dry pike
#
some_range = range(1, 10)
vale wasp
charred tusk
#

oh hi dan

modern hinge
#

ok thx

dry pike
velvet trout
#

Noice

lost lagoon
charred tusk
#

oh no

vale wasp
charred tusk
#

Could functools.partial help here?

vale wasp
charred tusk
harsh anchor
#

ranges are immutable

vale wasp
charred tusk
#

hmm

grim axle
robust ledge
#

Use clearly named variables for the min and max of the range. Use range where you need range. Make it readable without any guesses as to what is happening.

vale wasp
#

And, unlike Generators, you can reuse a Range

charred tusk
#

I didn't know that

dry pike
#

yeah range is a lazy sequence

vale wasp
robust ledge
#

pendantically; range is a range. Not a list, tuple, sequence, collection, generator, or otherwise.

velvet trout
#

It is a sequence and sequence is iterable.

charred tusk
#

!pep 8

edgy krakenBOT
charred tusk
#

Someone send this to the core team
they need it

velvet trout
#

lol

vale wasp
craggy trench
# edgy kraken

the new builtin class is in lowercase btw, so no lesson learned

vale wasp
velvet trout
#

Should be set as a goal for Python 4

#

x: Int | Str | List | Dict

robust ledge
charred tusk
dry pike
#

ohyeah

edgy krakenBOT
vale wasp
cerulean ravine
velvet trout
robust ledge
velvet trout
#

Since when

vale wasp
vale wasp
robust ledge
dry pike
#

mhm

velvet trout
#

Another huge W for 3.15

spice hill
unborn lagoon
edgy krakenBOT
#

stdlib/contextlib.pyi line 93

"Annotating the return type as `​-> Iterator[Foo]`​ with `​@contextmanager`​ is deprecated. Use `​-> Generator[Foo]`​ instead."```
gleaming knoll
vale wasp
craggy trench
gleaming knoll
velvet trout
#

Please!!!! Accept it for 3.15!

charred tusk
robust ledge
charred tusk
#

3.2?

#

Man, I'm gonna have to upgrade to that soon

velvet trout
#

☠️

spice hill
charred tusk
#

I think I remember reading something about that
That they explictly decided to ignore those

spice hill
#

why are you running both mypy and ty though?

#

just run mypy

velvet trout
#

Run mypy in strict mode πŸ˜‹ it helps solve a lot of bugs that i never expected

charred tusk
spice hill
charred tusk
#

It is vaugely annoying
I have to put

[tool.ty.rules]
# False positives that mypy sees
unused-type-ignore-comment = "ignore"
#

But I like seeing how the outputs compare

ashen cipher
#

woah did discord's syntax highlighting change

spice hill
#

I was just trying to see if ty supports something now, and the entire playground crashed and caught fire

dry pike
#

it did

ashen cipher
#

i like it

charred tusk
#

Does it actually work now?

dry pike
#

no the colors

ashen cipher
#

probably not but there's bold

charred tusk
#

Bold?

dry pike
ashen cipher
#

bold

cerulean ravine
dry pike
#

the colors changed, I thought that was what you were asking about

ashen cipher
#

what's the difference between an abstract base class and abstract art

they're both pretty abstract

robust ledge
cerulean ravine
lament bobcat
#

Do you have tips on finding modern stack buffer overflows not software patched but patched by hardware/OS/compiler security protection mechanisms in the latest technology? It’s for bug bounty testing.

modern hinge
#

why does isinstance(True, int) return True

ashen cipher
vale wasp
steady rain
ashen cipher
#

everything's a really big int in my heart <3

modern hinge
#

thx

main socket
#

guys , does anyone has an excell thingy that might help me to find some command/ libraries for python ?

#

im a beginner

spice hill
#

(True is 1 and False is 0 is false though, 1 is a distinct object from True)

charred tusk
charred tusk
#

You want a spreadsheet?

main socket
charred tusk
#

!learn

edgy krakenBOT
#
Go-to beginner resources

Here are the top free resources we recommend for people who are new to programming:

For a full, curated list of educational resources we recommend, please see our resources page!

ashen cipher
charred tusk
#

Do you have an example of the type of spreadsheet you want?

ashen cipher
#

well, only if a buffer overflow actually happens

grand bramble
#

#bot-commands

main socket
#

but like as i said , im new to python and programming overall xd

charred tusk
#

I don't understand the question

main socket
#

some of my friends just said that it would be useful to have one

main socket
charred tusk
#
(labkit) @shenanigansd ➜ /workspaces/labkit (main) $ uv run untw cache info
Path:    /home/codespace/.local/share/LabKit/cache.sqlite3
Size:    20480 bytes
Entries: 0
(labkit) @shenanigansd ➜ /workspaces/labkit (main) $ uv run untw cache path
/home/codespace/.local/share/LabKit/cache.sqlite3

Is there any reason to have a dedicated subcommand just to print the path?

main socket
#

not really

#

xd

vale wasp
lament bobcat
#

I’m actually fuzz testing using mutation fuzzing some of the latest technology right now but I haven’t found any vulnerabilities yet

paper kiln
#

Hello!

cerulean ravine
lament bobcat
#

Latest Unix 64-bit based operating systems and Apache2/nginx

lost lagoon
#

Teleportation pithink

main socket
shy salmon
#

hiiii

velvet trout
#

Hii

lost lagoon
charred tusk
#

/usr/bin/gnumeric-1.12.60 (part of Firefox) has encountered a fatal error and was closed.
yeah thats not firefox

main socket
#

πŸ˜…

lament bobcat
#

I’m going to post on Reddit

lost lagoon
#

Do as you pleased

spice hill
#

smh I can't reproduce the ty bug

#

only happens in the playground and under mysterious circumstances

#

I'll let their AI thing find the bug and fix it

granite wyvern
charred tusk
#

Yeah I just couldn't think of a reason I'd want a script to have just that one path unless I was deleting it

#
(labkit) @shenanigansd ➜ /workspaces/labkit (main) $ untw kerp process-art-for-domestic-master "Domestic Master 04-24-26.xlsm" 
Processing designs ━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   9% 0:39:30

whyyy does 17k x2 HTTP requests take 2h
someone buy them faster server hardware 😭

#

oh kek thast says 39

#

As soon as I grabbed it it halved
I guess it head me

#

OH

#

Is the cache already making that big a difference?

#

lol

#

27% 0:15:54
that doesn't seem quite accurate

#

I will say
It is very convenient of this vendor to have absolutely no rate limiting

charred tusk
frosty oriole
#

yikes

charred tusk
frosty oriole
#

http requests are embarrasingly "parallelizable", so to speak

#

(concurrizable?)

charred tusk
#

parallelizable

#

IDK how I'd do that with this data though
I'm iterating over a spreadsheet one row at a time and combining data from different columns to make my search query

I could collect ahead of time
But at least ~10% is duplicates
So I'd need to filter out all the duplicate requests but still remember which set of rows need to updated for a given request
And at that point with all that mapping, I'm not sure that would be any better

fathom beacon
#

does python-help do code reviews? Like more experienced people giving feedback about quality of code or is there another dedicated channel for it?

charred tusk
#

There's a code-review tag

fathom beacon
#

Sorry I'm lazy

#

thanks!

charred tusk
#

🫑

vale wasp
pallid garden
#

do note that the larger your codebase is, the lower the probability that someone will have enough free time to review it

charred tusk
#

Man I hate progress bars
The upstream gets mad at me and slows down? "2 hours remaining!!"
I hit the 500 duplicates in a row? "only 5 minutes remaining!!"

fathom beacon
#

Actually kind of staggering how fast you get responses in this server kudos for that

vale wasp
charred tusk
#

@pallid garden do !server

fathom beacon
#

!server

edgy krakenBOT
#
Server Information

Created: <t:1483877013:R>
Roles: 149
Member status: status_online 36,588 status_offline 384,623

Members: 421,211

Helpers: 161
Moderation Team: 34
Admins: 13
Directors: 3
Contributors: 47
Leads: 6

Channels: 333

Category: 36
Forum: 5
News: 14
Staff: 122
Stage_Voice: 1
Text: 142
Voice: 13

vale wasp
charred tusk
#

😲

charred tusk
pallid garden
#

the other programming servers have a ton of people too

#

but they are too busy dealing with the syntax /jk

raven urchin
# edgy kraken

I'll take notes for my own server, this looks clean af

charred tusk
#

The member count is MASSIVELY different

pallid garden
#

magnitudely different

raven urchin
#

I mean

#

Python is too cool

frosty oriole
charred tusk
#

Fair

#

It does take like a full minute just to load this file into memory

#

It's a 19 MB Excel file with values calcuated by macros

#

But once Python can get all the numbers it gets a lot quicker

frosty oriole
#

bro should memmap

charred tusk
#

Godlyyyyy

#

I should actually memray it
Just to learn how to use memrary
This thing takes so long to run I'll have plenty of time to push buttons

kind thicket
#

If so, a map/reduce style might be relevant

frosty oriole
#

i honestly think doing this in a threadpool would net you some big performance improvements

granite wyvern
kind thicket
charred tusk
grim axle
# edgy kraken

we have 122 staff channels? I think the count is wrong... there might have been many channels in the past; yet they are now removed/locked these days.

kind thicket
robust ledge
grim axle
kind thicket
#

faster to fetch 20 rows at a time than a row at a time

grim axle
#

right

raven urchin
granite wyvern
raven urchin
#

Guys, today has been a weird day for me. I want to code and forget about stuff, what do you think is best? Continue breaking my mind around Tic Tac Toe on Pyside or go and play Codewars :b
Other suggestions are accepted too

granite wyvern
#

Sadly, these channels were probably created in series.

grim axle
raven urchin
fathom beacon
grim axle
#

I, for example, am working on a config interface and console manager with a local webpage.
-# you'd be surprised how much functionality exists in modern browsers nowadays...

kind thicket
charred tusk
#

I'm actually curious what you guys would suggest

Deliverable

A production-ready bulk processing solution that:

  • Accepts a structured input dataset (e.g., spreadsheet) containing design identifiers
  • Processes the dataset against K-ERP systems of record
  • Returns an updated copy of the dataset with relevant licensing and file status fields populated

The solution may be exposed via one or more interfaces (e.g., CLI, TUI, webapp), to be determined during implementation.
- https://github.com/[redacted]/roadmap/issues/173
They wanted a website but my non-technical boss didn't want to "give away [compute] for free".
I've got this CLI just for testing. And apparently we're going to give the client the CLI for the beta phase but they're not happy about being forced to do "that programmer stuff".
My org is too cheap to get me a code signing cert for me to sign some desktop app,
What're my options for user friendly UI?

raven urchin
kind thicket
charred tusk
#

Oh shit its done

raven urchin
charred tusk
#
(labkit) @shenanigansd ➜ /workspaces/labkit (main) $ untw kerp process-art-for-domestic-master "Domestic Master 04-24-26.xlsm" 
Processing designs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:31:46

Yeah that's a QUARTER of the runtime
Dog bless cache

raven urchin
granite wyvern
charred tusk
charred tusk
#

holy fuck

ashen cipher
#

absolute dollar

charred tusk
# charred tusk holy fuck

There are.... 17,257 rows in the spreadsheet

(labkit) @shenanigansd ➜ /workspaces/labkit (main) $ uv run untw cache info
Path:    /home/codespace/.local/share/LabKit/cache.sqlite3
Size:    3604480 bytes
Entries: 9424
Namespaces:
  kerp: 9424

Only 9k of them are unique??
HALF of my HTTP requests were useless?????

ashen cipher
#

absolute duplicatoin

charred tusk
#

apparently

raven urchin
charred tusk
#

no wonder it made such a difference

raven urchin
#

I wonder why

ashen cipher
#

your median request is useless

#

your mean request is in a superposition of usefulness and uselessness but its leaning useless

#

of course that presumes useful and useless are equally weighted

charred tusk
#

I apparently really misunderstood the shape of the data

charred tusk
ashen cipher
#

i vaguely remember cgi but i als odont

charred tusk
#

o

ashen cipher
#

python had cgi support

#

until it got removed in... 3.7? 3.8? 3.6?

#

3.5-3.9

charred tusk
#

OH @ashen cipher its even worse

ashen cipher
#

?

grim axle
# raven urchin That sounds really cool, tell me more

I've got a program to parse and manage some personal data. the core logic is already done.

issue is that although I've put flexibility into the code, along with config files and other knobs and switches– going through the configs and manually modifying parts everytime I want to change something is tedious. it also lacks "responsiveness"; like I will need to restart the program to reload the new config.

so I thought to make a GUI. from personal experience, the builtin modules are rather clunky, so I turned to craft a web application.

stuff is much easier now; even added custom config reload events and more.

even better, it now pushes the output to a visual showcase; calculated by the browser (using JS, WebGL, and other external js libs). lately, I also added remote functionality, to view and access the program from my phone while away.

working on your own projects (or side-projects) is fun and very productive.
there are many (more) things to add, customize and modify! ducky_beer

charred tusk
# ashen cipher ?

I'm making two HTTP requests for each of my 17,257 rows
And I'm caching both of them
So that's actually 34,514/9,424

#

25k pointless requests?

#

I owe the upstream an apolgoy

ashen cipher
#

...

charred tusk
#

Lets try it with all the data cached

#

oh boy we trucking

#

21s total

raven urchin
#

My most interesting project is a discord bot, and making a single useful command takes me a whole afternoon of investigating and testing

#

I really need to get better at these things

charred tusk
#

Hey it takes me that long too
Discord bots are weird

raven urchin
#

Also, I absolute hate slash commands. They take too much to sync.

charred tusk
#

To much time you mean?

#

You can set a dev guild that syncs instantly

#

@frosty oriole knows that stuff

grim axle
raven urchin
frosty oriole
#

globals sync immediately now too

charred tusk
raven urchin
#

Maybe I did it wrong, idk

sand hornet
#

That's just Discord

#

TLDR Discord's caching issues and discord.py have been a long-fought argument between rapptz and Discord for reasons I don't even want to get involved with

raven urchin
#

I managed to replicate the player system

#

But I got stuck with checking wins and paused there

swift sparrow
#

Nice! Getting the hang of layouts and signals?

raven urchin
grim axle
# raven urchin I might have to try this, I usually follow the "If I can't make it, I shouldn't ...

lol. I usually follow, "If I can't make it, but need it- I should have it, then understand it".
-# note: this relates to real code; with some reasoning behind it.
-# often completed projects, preferably with a person to converse with, and understand their intentions & decisions.

-# AI code is rather peculiar, since it does not follow normal reasoning route; it does not have much considerations behind it- which often results in misleading and unreasonable coding practices.

swift sparrow
raven urchin
#

Also, to get the hang of it, I could also write wins to a file to save them even after the game closes

swift sparrow
#

sure, that would work

#

you could display a log of previous games too

raven urchin
#

I'll see what we can do today, I at least want to make the win check

swift sparrow
#

maybe using a plainTextEdit widget

raven urchin
raven urchin
swift sparrow
#

good for text editors, but I often use them to log things

raven urchin
raven urchin
native coyote
swift sparrow
swift sparrow
#

this is easily one of my most used pyside tools that I've built

raven urchin
#

Can I make a thread today too?

swift sparrow
#

sure I'll be around for a bit

raven urchin
#

Yay

fathom beacon
#

Do beginners actually read python docs, like no external libs?

#

sounds insane considering none of it makes sense to me, seems like more of a reference manual

cerulean ravine
swift sparrow
cerulean ravine
fathom beacon
fathom beacon
#

Maybe I'm just tired, I'm going to sleep goodnight!

cerulean ravine
fathom beacon
swift sparrow
#

there's a reason school isn't just handing you a textbook and saying "alright see you in 6 months"

pallid garden
#

maybe a closer comparison would be like a manual, or a dictionary

swift sparrow
cold kite
#

Hi

#

Am new here

spice hill
cold kite
#

I was told by a friend I can share my python projects here is it true?

charred tusk
cold kite
#

Oh nice

#

Thanks!

swift sparrow
charred tusk
#

I weep for everyone's social skills

#

It was a trying time

spice hill
#

i weep

charred tusk
#

πŸ«‚

cold kite
charred tusk
#

uhhhh.... no? I've never heard that before. Do you need help with Reddit?

cold kite
#

If you can help I will really appreciate

charred tusk
#

I've made like two Reddit posts ever

#

What do you need help with?

dry pike
#

nedbat mentioned

charred tusk
#

wat

dry pike
#

you said ned

charred tusk
#

o

cold kite
rugged barn
charred tusk
#

-# yeah

rugged barn
#

Hello dawg

charred tusk
#

Hello you

rugged barn
#

Been a while

#

What u up to

#

Besides hammering somebody's API

cold kite
rugged barn
#

I don't know
Ask Dawg

brisk gazelle
#

I think it'd be really cool if someone made an API for beehive environmental monitoring and called it ApiAPI.

brisk gazelle
#

Or APIary.

cold kite
#

Got free time on my hands currently

rugged barn
#

I don't think it's a weekend project

verbal citrus
#

i hate AI...i asked it to check the factuality of a convo and it argued with me until i proved it wrong.....sometimes it's genius ...sometimes it's like it's talking to a comatose idiot ..which then makes me suspicious of any complicated math questions i have for it crycat

cold kite
#

@charred tusk do you wanna help 😊 (am talking about the Reddit post)

brisk gazelle
#

Or some web service that gives you pictures of spiderwebs.

rugged barn
#

I wish I had some honey right now.
I could with some sweetness in my life

#

After the cold, bitter week.

verbal citrus
rugged barn
#

Yeah

cold kite
rugged barn
#

Why wouldn't I

verbal citrus