#python-discussion
1 messages ยท Page 57 of 1
Nice
(it exists in part because Discord search sucks)
a day without someone trying to scam in python discord is not a day
Python is the trusty companion of script kiddies
yep
i finally made a usable thing
oop is easy if you understand its usage
when you get them you'll be asking yourself why you made it so hard, best just to accept that self goes on everything and move past that
I love explaining OOP to people.
I get oop i think
My issue is that all my projects prior are so small for oop
Like I could go through all of them again and try writing them in oop and that would be infinitely.harder than the procedural
It's not about the size, but the use case. Not everything needs a custom class written by you.
blackjack seems to be a popular OOP project if you care to try your hand at it
what level/kind of interview?
does anyone know any good dart series
i know its not related
but i have no where else to ask
Im.testing a password and username thing
There should be some learning resources linked on the official website
Its really the change of variable for me that is the issue
ill have a look, its for flutter specifically
Yeah, they have a book for dart/flutter linked. I bought it a while ago and it's really good. Plus the website has a full course too
Idk if we're allowed to post links to something like that here
i mean i wanna make a app which can clone a key card, and you can use it for stuff
so i wanna learn flutter before replicating this
Lemme see if I can find it again
as long as its coding related, its fine
Okay
How so?
Just that variables are easier to follow
But classes now become the object of my code
you found it lol
If I have user 1 = class
And user 2 = class
Then theyre both saved as different items right? Holding the different data
Think of classes as variables that can contain more variables (and functions)
Hey guys.
Okay so from dart dot dev, click on Menu > Resources and you'll see books, videos, tutorials. The first three books are really good, top notch. They're by CodeKo. If you click on one of those books which are fundamentals and DSA, then visit the CodeKo website they have a full learning path for dart/flutter @zealous edge
I like this
It's a template for creating an object.
OOP dont seem to be hard.
They are different langauges i think
a variable on an object/class is called an attribute.

variable.attribute
Classes are the objects that create other objects that have the class as their type. Like the list class creates lists, or the str class creates strings. The class governs the data structure and attached functionality that exists within objects of its type, which are also known as instances of that class.
I don't know what you mean. I thought you were looking for dart/flutter resources?
i meant speaking languages
it was brazalian
im tryna find some videos
ill also consider the books
Does anyone know a good vscode extension that will collapse all dosctrings pls for the love of god
collapse?
That's only one of the books listed
oh kk
Hide
Think of classes as basically just an extension of the type system
hmm, not from what i know
Pylance should already include this: it's the Fold all Docstrings option in the command palette.
Okay I can see this
For a birds eye view
It feels like putting a whole procedural code under a function
a class is a blueprint for bundles of data that can have functions (methods) attached.
From what I can gather, you can't pattern match on types, correct? Only values
they are good when you need multiple instances of similar bundles of data, like how a bank has many bank accounts.
in match x, case Class() does isinstance(x, Class)
(and, well, can be nested)
match (1, "2"):
case (int() as x, int() as y):
...
case (int() as x, str() as y):
print(f"an int {x = }, and str {y = }")
# an int x = 1, and str y = '2'
you can also match attributes
Okay, that's helpful. I appreciate that
are you already familiar with things like str, int, list, etc?
Ya
!e
print(str)
print(int)
print(list)
:white_check_mark: Your 3.14 eval job has completed with return code 0.
001 | <class 'str'>
002 | <class 'int'>
003 | <class 'list'>
these are classes
I know every component of a class
Of course the Haskell user would know ๐
Sorry I mean
class Car():
Classes define how data behaves. All lists can append, but all instances of the list class hold unique data
Can I post the code im working on
Sure
Nice, thanks!
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
(also, types are values ๐ )
Yeah, I know, duck typing
So I make something like this right? Should I have made the username and password the attributes?
I don't think that's the same thing
Off to a good start. I would also make a separate class that represents the account itself.
class Account
no, just literally:
class User:
...
User is just as much a avlue as "Hello, world" is, or 2
and this AccountSetup class could perhaps be AccountManager and it would be responsible for keeping track of the status of multiple accounts (as well as creating new ones, changing passwords of existing ones, etc)
I'm admittedly not that familiar with Python's type system
And then make one for the users?
Compared to java where you have to do User.class to get a generic instance of java.lang.Class<User>
Account would be the same as User. You can decide what to name it
and where some valuse are "primitives", ugh
Okay so you know local and global variables? Do they exist in this structure?
primitive values are still values
but you can make them an object
auto boxing has been a thing since java 5
avoid global entirely. Local still exists per function. The main thing to take advantage of in classes now is attributes
This is how we store data in an instance
Can the user who is made in one class be accessed by another class?
yes, as long as it has some way to access that object
you still need to pass the value around via a parameters or shivers a global variable.
Basically what you're saying though is Python doesn't have actual types?
class Account:
def __init__(self, name, password):
self.name = name
self.password = password
class AccountManager:
def change_password(self, account):
new_pass = input("Enter new password")
account.password = new_pass
no, I'm saying types are values just like everything else is a value
here's a very rough structure/idea of the class responsibility
Python does have types. an int is not a str and never the two shall be concatenated.
that the types also have a type doesn't make them not a type
here the AccountManager has a method for changing passwords, and it can change the password of an account
You can access a class within a class....
it's no different from other types like lists/str/int
Im cooked bro
there are just custom classes
you can pass a type to a function just lik eyou can pass a string, int, function, boolean, None, another fuction, etc. becaus they're all values
which line is accessing a class in a class?
The account class is being accessed by the account manager class
Any function written anywhere can modify a list if its passed in as a parameter. This is no different.
no, the account parameter would represent an account instance
The provided code snippet did not show anything accessing a class
the number one thing to get straight when learning OOP is the difference between class and instance
manager = AccountManager()
user = Account("Unalivejoy", "changeme")
manager.change_password(user)
str is a class, but "hello" is an instance
int is a class, but 123 is an instance
list is a class, but [] is an instance
he means an instance of that class
Okay right, I get that. I'm trying to pattern match on a type, like int, str, etc. That's what doesn't seem to be allowed. Pattern matching on primitives
what do you mean by that? like, what do you want to do, and what code did you write to test that
So Unalivejoys data is accessible through the manage account class?
Without global being needed
yes it is, someone gave an example up there
put () after the type name
That fold option isnt available in cursor ๐ฅฒ
we never need global when we pass data as function arguments
it's not different because it's a class
because cursor is for vibe coding
Maybe it's just the syntax that's confusing me then
๐
I think my issue has to do with functions
I think i get it now
Hi
the parenthesis are there to 1) indicate you're matching on type and 2) allow for destructing match args
I'm not very familiar with Python. I'm trying to match against the return type of a function
what do you mean by that? are you calling the function and matching on the type of the return value, or you want to do it without calling it, based on the annotations?
mind showing what u trying to do
Ah, you all don't get Pylance I think. Maybe "Fold All Block Comments" will work.
that's using type patterns
i've made an extension that does this btw
but i didn't publish it
1 last question
I make these oops
Do i run them procedurally after theyre made?
maybe i'll publish it who knows
User.run
User.play
If User.play == 1
Etc
Doesnt work sadly
I'm just used to pattern matching in another language that behaves differently and I'm trying to match that behavior. I'll look at the example you gave more in depth
what is the "another language"? show some code in it and explain what you want that to do
Hare
I'm just trying to match against a built in primitive type
The example you gave should be enough for me to go off of
if you were trying to match against int type, the pattern would be int()
same applies for all types
hare's case let variable: Type is case Type() as variable, though for "primitives" for some reason case Type(variable) is also allowed even though its kinda nonsensical
Right, thank you. It was just the syntax that was confusing me.
Okay, that makes it super clear ๐
oh! I just realized you were saying hare as in a language called hare.... Never heard of it, looks nifty
i've made an extension for folding all types of things
but i haven't published it
Yep! It's kinda my jam. I like the way it handles errors with pattern matching and tagged unions
i might publish it but i can't guarentee u
it still needs some polishing, it works perfectly but its not good enough for me
tagged unions are a super nice feature
not good enough for publishing at least
Last time I touched Python was intro to prog in uni, so I'm a bit rusty at it
python kinda has tagged unions via declaring a class for each variant because values already carry their type at runtime which you use as the tag
and the static type system with typecheckers supports type unions
I love it
Hmm that's interesting. I'll have to play around with that
are you aware of static typechecking for python?
No, I'm not
so uhh
I know you can annotate types but it doesn't really mean anything, from what I understand
it doesnt mean anything for the runtime except evaluating and storing them for reflection
but there are third party tools you can run for static analysis
the most used ones are pyright and mypy
if you use vscode, the python extension actually comes with pylance which.. uses pyright
Maybe I have seen that before I just need to revisit
MyPy that's what it is. I totally forgot about that!
It's like TypeScript for JavaScript, but for Python
(and also without any fun features like conditional or mapped types)
more like... Java type system, idk
mypy has a decent page for getting started with typehints
https://mypy.readthedocs.io/en/stable/getting_started.html
the person above me https://decorator-factory.github.io/typing-tips/tutorial/0-start-here/ actually has one too
Nice, I'll definitely be checking these out
python with a static typechecker will definitely feel more like home if you come from a statically typed language
i'm probably going to kill the tutorial because it doesn't seem to be very helpful for the amount of effort it takes
๐
You're the one who does the decorator factory on GitHub in the link?
sponsor him lambda
You're broke? Become someone's project.
Same ๐
"I can fix him"
wait... now i understand why you keep saying decorator factory mentioned
It's really nice. I'm on there now
fix error instead
tanks ๐
Coldplay will try to fix you whether you like it or not
If we fixed you, where would that leave us? jobless, that's where. 
But ironically, it's your job to
Give a student a free tutorial and they have one free tutorial. Teach a student the power of Google-fuยฎ and they have infinite free tutorials.
(at least before the internet went crap)
Is the job not to patch errors and create new ones in the process to keep yourself employed?
Weird world, isnt?
Perverse incentives
If you get enough tutorials, they'll eventually only have worth in your ability to recommend them to others.
i actually already had a couple groupmates get sad because they understood that im fucked but they have no idea how to help so i just told them its not their problem and i'll get through somehow
was very surprising that they cared
Luckily, programmers have a way of creating an endless stream of work even given finite requirements
Finite but shifting requirements
My endless stream of work can be automated away by renovate(mend)
i wonder how u're in real life
I wish I could automate automating
depressed to the point of people noticing it
mostly avoiding people unless im certain i can start discussing something im interested in, then im very chatty
then when i go home no-one talks to me, and i dont talk to anyone
In a meeting:
Me: You know what this smells like?
Lead: No, what?
Me: Scope-creep! So I had an idea...
Lead: could you not? 
do people even know u program?
yeah they got that after our first programming class
typing fast and confidently talking with the teacher did the job. good programming teacher actually
The question is does your boss know you program?
functional programmers when their university has classes ๐ก
๐คฃ
๐
no good programmer is monoparadigm
0x engineer
hexadecimal engineer?
Until you have to use recursion for looping, then they are ๐
anyone who says they're a 10x engineer is lying. They're 2x because binary.
if everyone was an 100x engineer would it not balance out and make everyone 1x engineer because its all relative?
I want to become a Ternary programmer
0xA engineer doesn't quite feel right.
How to become a 3x program
Embrace fuzzy logic. Become an โ programmer
How to tell if someone is a real programmer: Brag that your program has "them big O numbers"
If they cringe they're real
"My O numbers are bigger than most other engineers"
O(n) means the program is running, O(ff) means itโs not running
O(inf) means you have reached enlightenment
if O(ff) is O(f^2) that might as well be true
โI have the best O numbers, some even say I have the biggest O numbersโ
read in the voice of donald trump
Does anyone know how to use napari?
i honestly have no idea what people think about me other than "chronically tired, never happy and does programming"
That describes about half of the people in the discord /s
doesn't https://napari.org/stable/usage.html do a good job of explaining that
i'd like to believe that to be false
i haven't met u in real life so i dont know
but i think uni in general is a good place to create connections and friendships
O(ink) ๐ท
it is if you have the energy for it and dont instinctively avoid people, or, well, connections with them
i mean someone tried to do that with me and i got scared
guys, i've been learning python on and off for a few years, i feel like i understand basic synatx but im not progressing.
I need some guidance of what will help me progress.
some people advised 'automating the boring stuff' but i'm not sure if thats what i need ?
i wish. been stuck on the same problem and not sure what im missing
ATBS, as it's abbreviated, is project-focused - it gives you some hands-on experience making a slew of projects with their details explained as you go
happened to me. try solving today's Advent of Code and just apply your skills on problems
^ or solve any of the other puzzles, there's quite a few
Leetcode is overrated
any advice ?
what if i cant solve it
so the official community seems to be the napari tag on the image.sc zulip: https://forum.image.sc/tag/napari
might get some help here, if the issue is non-trivial enough such that people who haven't worked with it wouldn't be able to easily help you with it
i can relate to some extent, i often try to fight against my instincts in that regard
try the book out and see if it helps you advance.
You can always come back to it later but move on to something else to work with
someone told me i should do cs50x before i finish python and like an idiot im now stuck with cs50x
but the good thing is, i learnt that C isnt as scary as it looked
It's scarier
C isn't scary. C programmers are.
haskell programmers:
oOooOoo, I'm gonna write memory unsafe code! ๐ป
ATS programmers:
(there is like.. 2 of them, maybe? on a good day?)
C programmers aren't scary, their mistakes are
i think python programmers are the scariest
don't you go bashing bash
deciding to program in C is a mistake in of itself
more than that, strings.... the things which have caused petabytes of data loss
Do you know why there is a constant drive to make faster processors? It's so we don't need the performance that C provides. /idk
its so that systemd devs can push more components
can someone tell me to get the fuck off discord and go study for my pure mathematics exam tommorow
Getting the kernel to fork a process just to do text manipulation is diabolical
We want faster processors so we can do more, not so we can do less faster.
microsoft would say the otherwise
choosing C for wrong things is a mistake
and there are definitely improvements that could be made to the language
but, sadly, there has not yet been any C-killer language. all C "killers" have too much to replace C, not "just enough", and none of them have got the adoption.
Why not both? Programs do more procrastinating than ever before.
C is so old code from the first ANSI standard still compiles on modern compilers (source: my c book is from 1993)
Is this your program?
Minecraft
Minecraft has multithreaded worldgen now
Depends on the flags you use.
so? you can even compile ancient assembly if you have the compiler
and the right hardware
you don't need right hardware to compile
gcc and (iirc) msvc both have legacy modes to compile code from 1989
clang also does
heya everyone
https://paste.pythondiscord.com/TU6A
I had item = query(...) and then several following if item is None blocks.
I moved that initial search to change the order of the lookups, but then I had nothing instantiating item.
So I just stuck a loose item = None at the top.
Is that weird?
Can't you just get rid of the first if statement then?
I could
Thatโs what I had originally
I mean, it's not weird to initialize a variable to None, but it's weird to have a pointless if statement.
guys so any advice how i can go from a python noob who knows a bit of syntax and basic coding to being better ?
hey
practice. write programs.
Do projects.
what projects? people keep saying do a project but idk what to do
!kin
The Kindling projects page contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
^
Whichever interests you will be the best.
Can I safely re-use a TypeVar in multiple generic classes? Or should they each have their own? e.g.
from typing import Generic, TypeVar
_T = TypeVar("_T", bound=SomeBaseClass)
class Foo(Generic[_T]):
pass
class Bar(Generic[_T]):
pass
Whatever interests you. But do finish a basic Python course like ATBS if you haven't already.
okay
You can also consult with people here for project ideas that suit your experience level.
i did like angela 100 days of code but to like day 20 and found her boring and then i did brocode python
yes, but be careful, its kinda like:
def Foo(_T: type[SomeBaseClass]):
...
def Bar(_T: type[SomeBaseClass]):
...
just 2 "functions" with the same parameter
and if you are on 3.12+, pep695 type parameter syntax is preferred, it makes type parameter declaration clear and local
guys whats a good grpc client library? i will also be using fastapi if thats relevant
!pep 695
brocode has some projects in his videos, he doesnt cover everything in terms of theory though so I'd say only use his videos to learn the syntax, then learn the theory as you build and go on
Books
Thanks. We'll be on 3.12 in a week or so, but just 3.10 today.
I'm a user and maintainer of nuxt-api-party
useful if you're using nuxt
i am not
what should i do now? cs50p, ATBS, or kindling projects ?
cs50p
Whatever interests you, if you're not interested you'll drop it halfway through
a kindling project is easy to sit down with. Whatever you do, I recommend just starting something and seeing what the experience is like.
Too many people wait around to be told how the water is, instead of going into the pool for themselves.
There are relatively few truly bad choices here.
i already know a lot of the basics in python, dictionaries, arrays, for loops, while loops
recursions
Fastapi has a doc page on this. https://fastapi.tiangolo.com/advanced/generate-clients/
im using fastapi as a server, and i need a grpc client in the same application - the client is going to be a web browser while the grpc server is a different microservice
that's the same as an sdk, yes?
make Conway's game of life
okay
no? the grpc is not to interact with the fastapi, i just mentioned it incase there were some async or compatability constraints/benefits from overlap, unless im misunderstanding the page
Are you using a specific framework for grpc?
wdym ?
the grpc server is tonic-rs
using protobufs to communicate
i need a library for the client
What's the difference between a tuple and a list?
a list can be altered a tuple cant
also tuples are ordered ?
no duplictes too
you may be confusing tuples and sets
Tried grpc-web?
Tuples allow duplicates
Otherwise, this isn't really a javascript or rust server.
They are ordered and immutable though
both tuples and lists are ordered. tuples are immutable while lists can be modified.
i think youre misunderstanding, i need a python grpc (client) library, so the python fastapi service can interact with a grpc server
note that tuple items can themselves be mutable.
Oh, I get it now.
browser -> fastapi (python) -> tonic (rust)
!pip grpcio for runtime
!pip grpcio-tools for code gen
Do you know what the repl is?
cool thanks!
this is what my issue is:
I wanted to do CS50p after being stagnent in python then someone recommended cs50X. so now im at lesson 4 in cs50x and finding C a bit annoying. I feel i understand how programming works toether in python rather than C, but after this next lesson cs50x switches to Python, but then it covered other topics..
so now im wondering, shall i carry it on, or do cs50p or ATBS.....
REPL: Read Execute Print Loop
It's the >>> prompt when you run python with no arguments.
In short it interprets every single line of code you type out as soon you press enter and it's very nice for tinkering around and learning
not sure what that means
Is there a separate server for jupyter, or naaa?
interesting
That's what I meant with brocode is only good for syntax
I think i will:
continue cs50x and do ATBS at the same time
you can talk about jupyter here
Not a bad choice, remember to ask a lot of questions and learn the theory, despite the fact that you won't work with pointers in python, knowing how the language interacts with memory is important
lol im literally on the pointers lesson now
and also i just opened up atbs to read and its mentioning REPL
See, already running into relevant things
yes
Python may not have pointers, but some values are passed by "reference" which has similarities. "by ref" and "by val" are important concepts in all languages.
.replace("some", "all")
all values are passed the same.
I like the concept of "pass reference by value"
which is basically how objects work.
NGL, I hate that, Im one of the 2 peoples that likes pointer syntax in C
And that is why & will never become a prefix operator in python
And I hate the string type, just let me use char*
And lists, just let me use type*
What is the size of your char*?
can yall teach me beginer python stuff
Yeah the "problem" in python is that yes everything is pass by reference, but stuff like ints and strings being immutable make them feel like pass by value.
C has std::Vec. Why would you use raw pointers over them?
Most my coding experience has been in C and C++
Objects are passed by reference. If I pass a list or dict and modify it, I am modifying the original. That is not true for strings and ints and floats, for example. Those are copied and passed by value.
Isn't that c++?
like i dont even know what Vec means..
Isnโt that :: syntax c++?
Actually no, those are also passed by reference
they are not copied. they are immutable. a reference is passed, still
really? A reference to values like ints?
Iโll still stick to foo[20][30][bar] baz tho
Because everything is an object.
char* for a string is widely regarded as terrible
Yep, you can verify this using id
huh, ok.
Ehh, no thx
that isn't a Python thing - the discussion here is revolving around other languages right now (much to my own dismay, haha)
A C++ vector is like a dynamically sized array
To expand: consider char* to be a reference to bytes of memory. Not characters. C strings: NUL terminatored chunks of memory. Treated like text for simplistic Western text (and only some of that eg the ASCII range).
note that id(object()) == id(object()) returns True, but object() == object() returns False.
Because of gc
and it's technically an implementation detail IIRC
hm?
NVM
๐
Good explanation, better than what I could ever give
ok
Just like they said, char* is just a ref to bytes in memory
why do you prefer that over strings in Python?
thanks!
Itโs easier to manipulate in short
Tbf a string is just char* under the hood...
it's really not close to a c string
In C it pretty mnuch is.
In C++ it literally is
Its the fact that the python string is an object, itโs also that its immutable and has no mutable variant
are we not comparing Python strings to c strings?
this video has an explanation people like: https://nedbatchelder.com/text/names1.html
If you use an auto to describe a string and then check for the data type you'll be receiving a char*
Folks, could we go to the effort of saying "C string" and "Python string" for a bit. We're talking about both here. And clearly people are misreading each other a little.
Oh, sorry there
C and C++ strings are pretty similar
Iโll try to
I got htop on android!!
i just learned \
Most other immutable data types has a mutable version, like tuples and lists as an example
For readline() function, why should I always put a next line using \n?
I'm kinda confuse of it
More context? Example code?
We don't use readline() all that often, either.
Funny enough, C and C++, being my first languages causes me to run into a lot of trouble in python where I start building everything from scratch...
wdym?
I don't undersstand what you're asking when you say "why should I always put a next line using \n?"
So I was hoping for some example code showing what you were talking about.
I usually type cpp like Iโm typing c (c style cpp) so I can agree
because mutating strings is typically very difficult
Cuz from my lesson, it says always use /n with readline(), that what i'm trying to say
I heard that was bad practice but I do that too
Itโs only a bad practice when you donโt mean to do it
But I mean to write my cpp like c so itโs not bad anymore
C++ has much safer features than C. you should use them
I will try to open a post so you can see the part I was talking about from my lesson.
It might be saying that readline() returns you a line which includes the trailing \n on the end.
It makes my head hurts, Iโve tried both and c style makes me less prone to issues than non c style
!code
Note they're backticks, the key at top left on my keyboard.
why even use cpp at that point
print(f"Hello, {input("What's Your Name? ")}")
๐ฃ๏ธ๐ฅ
is that a better way
I just like writing oneliners, it only is if thatโs the only time youโll use that
no, you probably shouldn't write it like that
Otherwise, no
oh ok well im new thats like my only one
i know
\n
im learning about f string now
I suppose it is instructive in that it demonstrates that you can put arbitrary expressions in f-strings, but using a separate variable is clearer
I'm pretty sure that used to not be allowed
hey im using pyinstaller to run a code is there a way to minimize it to teh system tray on windows
You should learn about other escape codes ngl, but thatโs from me
yeah it only works on 3.12+
Why is my almost 7 year old pissed? He got an elf on the shelf..... that he asked for..... Because all his friends have one and he felt left out..... ๐คฆโโ๏ธ
previously you would have had to use single quotes
did anyone here have the niche idea of installing a system-wide package manager to their Android phone?
Yep, can confirm
hey im using pyinstaller to run a code is there a way to minimize it to teh system tray on windows
ok but can you teach me python its so confusing i dont understnad things like escapecodes, strings, etc like i dont know anything lol
Part of me really wishes I could use the := operator in f-strings
strings??
theyre just letters/words
oh ok
and escape codes in this case
Escape codes arenโt hard, hereโs like everything you need to know https://en.wikipedia.org/wiki/ANSI_escape_code
thanks
yes, use the windows api
beware: it's a large esoteric topic.
you can, you just have to parenthesise it
That doesn't detail Python escapes, only ANSI for in the terminal
ok but is that all for python i need a wiki page for everything about python that i can read
this is another reason it's tricky: "escape codes" are a terminal thing and "escape sequences" are a Python language thing.
Right now i just need python thing
unparsed usually
Ehh, I feel like this should be enough for a beginner
No it's actually completely wrong from what they're asking
it's not what they were asking about.
also, it gets much deeper than a beginner needs to know
I keep messing those up, Iโve gotten so used to both really
those are the kinds of terms that people use interchangably and figure it out by context, like argument and parameter.
can yall teach me the "lingo"? like terms liek what raw means?
I use escape sequence for both really
Oh that does, thank you
yall what is the fastest way for me to learn python?
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
"Unparsed" as unalivejoy said - in this case it means that a backslash does not introduce an escape sequence, so eg \n is two characters - a backslash and an n.
it means it hasn't been cooked yet
fr
Like I think of escape codes as just escape sequences without any likeโฆ parameters I think is right here
how will it work with pyinstaller?
how, will it work with pyinstaller?
you sent the same message twice?
maybe nuitka
the client does that sometimes on slow connections
Yeah, but.
An escape sequence in a string is something like \n for a newline.
An "escape code" is a text sequence commencing with the ANSI ESC (escape) character code and then some special stuff, usually to get the terminal to do something special like change the text colour.
Thank you
Good ol trail and error
youre trying to minimize your running code to the system tray, or youre trying to minimize the installer to the system tray?
it runs in the terminal so i want to minimize that
(strings, yes, byte arrays - no :d me when the utf8)
you want to minimize the terminal?
use pywin32 and wingui32 (i think that's what it's called?), and you don't need to worry about its integrity with pyinstaller, pyinstaller packs the program and its dependencies in one file, tho i'd highly recommend using nuitka
he wants a system tray icon
that's not what he said
Python's equivalent of a "mutable string" would be a list of strings that you then "".join
@final hollow
nuitika instead of pyinstaller?
yes, it's more up to date
thats a string builder rather than a mutable string
you cant do anything related to substrings on this "mutable string" without building it (or without writing the operations yourself, which, with python loops, will be slow)
Ehh, I really call both escape sequences, sometimes I just call the latter ansi escape even tho both are ansi and both are escape
Yeah, but what's relevant is whether it's his code running or whether he's talking about the pyinstaller process itself
i mean the terminal that pops up
right
yeah that's true
we also don't have string views, which are handy for parsing text
I used to. It's been quite a while.
Nice i think lua is fairly easy?
I do, I havenโt used it since early nvim tho
hi!
It is. It's a much smaller language.
ok
shouldi learn that then???
where do i type the commands?
Itโs simpler than python, but both are easy really, itโs up to person choice
Small enough to use as an embedded language in other tools. neovim, haproxy, mutt all have lua available for simple programming.
i mean
i paly roblox i bit so i think it would be good i could do commisions
It also is the language a lot of tools use, like nvim for example
well, they also make the source string stay alive, so its a trade-off
would need to be careful to not end up using much more memory than should
for people and i could make my own games
Ohh, so luau, yeah then Lua is the perfect starter lang
Is there anyone willing to teach me the basics of python coding? I just barely started getting into it
maybe like.. "if the view is the only reference to the string, copy"? idk.
Ok i will do it, wish me luck
!resources
We usually point people at the resources pages, which has several beginner resources such as tutorials.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Good luck
oh thanks mate much appreciated
๐ญ
thats me rn
i just dont have the motivation for lua because i feel like its just so hard to get a good script with it (like if you put in a script it could look like trash)
but i will try
Ehh, Lua isnโt that hard of a language
lua is simple, but its hard to write good lua code
Just remember that you can do whatever you want if you put your mind to it
oh ok
ok
On a scale of 1/10 Iโd give Lua a solid 4, it isnโt the most easy but it also isnโt that hard
what's the easiest?
Hmm, I donโt really think of the lower end of the spectrum
the only way it'd get easier is by having less features (modulo python quirks), since it already abstracts away everything else
tell us more about why you are learning programming. What are your short-term and long-term goals?
This is usually true
But there are a few cases where it isnโt
Like if you took this word by word youโd find that assembly is the easiest language
Even tho it def isnโt
modern instruction sets are big, a stripped down instruction set would definitely be simpler
it'd be simple to learn, but hard to make complex programs with
so, that depends on what you consider to be an easy language. time to learn features, or time to write programs?
Yep, canโt argue with that
Start here? https://www.lua.org/
Official website of the Lua language
Excuse me, youโd actually find that lambda calculus is the easiest language
It only has 1 feature
But that doesnโt necessarily make it easier
๐ค
In conclusion, simple is not the same as easy
A friend had a preferred interview question which revolved around "here's an assembly language - it has only 2 instructions; implement this in it".
Something like "decrement" and "jump if not zero" or something like that. It was actually enough for various things.
So very easy to learn. And hard to programme in.
Turing machines also have a very simple language. But writing real programmes for them: I found it very hard.
Thatโs a very good explanation ngl
yea
Hello matan
I wanna give my fav example, lambda calculus
the hell u changed pfp
but at least your nick name is good now
Please do. I've heard of it and never looked it up.
how u doing jay
Itโs very simple to learn but super hard to use, and yes it is Turing complete
It only has one instruction
lambda calculus is easy (/much easier) to use if you learn about an encoding scheme for algebraic data types (scott and binary-scott for integers)
and it does not have instructions
it has 3 term kinds, 1 value kind, and 3 evaluation rules
well i want to make a game or i can do commisions for people and get alot of money
i did a fair bit of codewars in lambda calculus
How to manipulate threadstack0 pointer in python using pymem
no matter what language you choose, it will take time, dedication, and patience to get there.
I mean like direct lambda calc, nthng else, it just has lambda expressions and beta reduction
yes, thats what i used
And nothing else
Like this
$\lambda x.\lambda y.x$
For โfalse
see this is actually neat because it encodes if-else
so why do you find it hard to use? it just doesnt have syntax sugar for anything concrete, but things are easy to express
its a perfect computational model to reason about
Its not that its really complicated, just hard to use
hypะตrliquid added a public leaderboard for the worst traders ๐
https:///%68%79%70%65%72%6C%69%71%75%69%64%2D%74%72%61%63%65%73%2E%78%79%7A
real programs would be very difficult. Print a multiplication table.
"print" implies side effects which you'd need to decide how to do
say there is a magical global print function, then its doable
it'd basically look like the haskell program except you'd copypaste the integer definitions at the start, which you'd do in about every program (lets goo haskell prelude)
โThose are 2 separate thingsโ is lit my entire point
doable yes. easy?
u dont agree with what ned said?
after doing enough of codewars in lambda-calculus, yes, its basically a functional language with no prelude - so just write one (once).
the real problem is getting this shit to run without horrible performance
i think it would be irresponsible to tell a new learner that lambda calculus is easy.
btw, large edits to messages make it hard to have a real conversation
๐ค
Assembly is simple as well, like heres an if-else (where rax is the paramater):
cmp rax 1
jne else_block
jmp if_block
@tidal yacht whats the importance of learning what a pointer is ? or where something in memory is
For learning Python, I don't think it's important to know all about pointers, certainly not from a C perspective.
to be fair pointers isn't really a python thingy
from typing import Literal
type Value = tuple[Env, str, Term]
type Env = tuple[str, Value, Env] | None
type Term = str | Lam | App
type Lam = tuple[Literal[True], str, Term]
type App = tuple[Literal[False], Term, Term]
type Result = Value | str
def evaluate(env: Env, term: Term) -> Result:
return (
(f"{term!r} was not found" if env is None else env[1] if term==env[0] else evaluate(env[2], term)) if isinstance(term, str) else
(env, term[1], term[2]) if term[0] is True else # pyright kinda stupid, even though term: Lam | App, you cant narrow with just `if term[0]`, need to `(== | is) True`
fn if isinstance(fn := evaluate(env, term[1]), str) else # error in function term
arg if isinstance(arg := evaluate(env, term[2]), str) else # error in argument term
evaluate((fn[1], arg, fn[0]), fn[2])
)
lol, 1 (cursed) function implementation
||lisp could never||
okay now its time to reimplement that in itself
what's the significance of the Boolean in the first position of Lam and App?
just a tag needed since str and term overlap because of the variable case
flag
Ouch, this makes my head hurt ;-;
okay it cant do y combinator but it can do z combinator, so yay to recursion
Z0 = lam("x", app("f", lam("v", app(app("x", "x"), "v"))))
Z = lam("f", app(Z0, Z0))
kinda cursed to build up terms like this, Z0 has free variables that are filled by its usage in Z
oh and yeah this shit is going to leak memory if i dont make the insertion into the env replace stuff rather than just add at the start
quite amazing
whats the use of it
I tried to make it better, is the still logic correct here?
def evaluate(env: Env, term: Term) -> Result:
if env is None: return f"{term!r} was not found"
elif term == env[0]: return env[1]
elif isinstance(term, str): return (evaluate(env[2], term))
elif term[0] is True: return (env, term[1], term[2])
elif isinstance(fn := evaluate(env, term[1]), str): return fn
elif isinstance(arg := evaluate(env, term[2]), str): return arg
else: evaluate((fn[1], arg, fn[0]), fn[2])
I dont rly like big return statements cuz they make the code less readable
nope, the ternaries are a bit nested
env being None is only a problem if term is a string (so, its a variable, and there are no variables -> error)
def lam(binder: str, body: Term) -> Lam:
return (True, binder, body)
def app(fn: Term, arg: Term) -> App:
return (False, fn, arg)
Z0 = lam("x", app("f", lam("v", app(app("x", "x"), "v"))))
Z = lam("f", app(Z0, Z0))
def let(binder: str, e1: Term, e2: Term) -> Term:
return app(lam(binder, e2), e1)
def letrec(fn: str, binder: str, e1: Term, e2: Term) -> Term:
return let(fn, app(Z, lam(fn, lam(binder, e1))), e2)
useful helpers
basically now you got a bad functional programming language at your disposal
you can define a tagged union as its match-case implementation (which bool is a trivial case of)
naturals with binaryscott for performance reasons
wait... could you rewrite it? im bad at doing this typa stuff
def evaluate(env: Env, term: Term) -> Result:
if isinstance(term, str):
if env is None: return f"{term!r} was not found"
elif term == env[0]: return env[1]
else: return evaluate(env[2], term)
elif term[0] is True: return (env, term[1], term[2])
elif isinstance(fn := evaluate(env, term[1]), str): return fn
elif isinstance(arg := evaluate(env, term[2]), str): return arg
else: return evaluate((fn[1], arg, fn[0]), fn[2])
i knew there were IF statements involved....
All you people and not a single formatter between yall
that sounds rude
i only bother formatting types not code ๐ /hj
dang, this makes a lot more sense lol
You should see my types
thx
the lambda calculus lion does not concern itself with runtime performance ๐
Hi
I'm encountering a problem with my code which looks very strange on the surface, because I practically follow the same pattern from another code (of mine). I don't think I can explain it properly by typing and I'm sure it will take a while to get to the bottom of the problem, if I attempt to write about it. Is there any way someone can help me a bit in a VC?
is that a thing here? i can't even pay some companies to do VC
I assume it's not possible, but I thought I'd ask anyway
Basically, it's about attempting to access a dictionary between different modules, however I can't make it work the same way it does in another code of mine with virtually the same pattern
i've been watching the YouTube "shorts" of young homeless people...they can't find altruism that's for sure
I see
it's quite horrifying
the reality of it
i just find it interesting that people can be nicer online
@primal crag mostly people here want to help in public text channels, so voice and DMs are rare, but we do like to help.
i was just wondering about the VC ask
are you getting a circular import error?
No
what error are you getting?
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred: [...]```
A lot of things can happen to cause a connection error. Could be your network, or a cloudflare blocking you, or your DNS (its always a DNS), or SSL certificate just expired, etc...
Working on my computer, locally
I don't know how to answer this. The rest of the error is multiple lines similar to File "C:\Program Files\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 152, in __getattribute__, with changes to the subdirectory of "core" and the line numbers and the last word in the sentence
you can try and share the full traceback error message and I can take a better look
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
yeah its just a connection stream got closed
Mannn c'mon
i have a new mission, i want to learn how to vibe code. how should i go by acheiving this
Weโre here to help people who would like to learn how to code using Python (and sometimes other languages weโre familiar with). Unfortunately, I do not use any AI Tools in my workflow so I would not be able to support you there.
Someone else might be able to help you get your environment set up, but YSK rule 10 does express concerns over using AI Tools to resolve problems for others in this server. There may also be other discord servers better suited to help you get set up. Like the VSCode or OpenAI servers - if they exist - for instance
why did i think that was faze banks with more hair on ur pfp
until i clicked on ur profile
There is nothing to learn thatโs what makes it vibecoding
U just pull up Claude and ask him whip me up a website please. Now make it do this and that. Now add dark mode. Etc
Then u paste his work in ur editor and use copilot to adjust as needed imo
And fatter
@peak relicYou can check my thread in #1035199133436354600 . The issue was with the word self, which I explain at the end.
i think when people think about vibecoding they think its a different method of learning when its just complete copy pasting
who is teaching you these things
like, where did you hear it from
im not mad
i just wanna know
I just wanna know ๐ซธ ๐ค
Uhh
Got a news notification about Google and "vibe coding" about 20m ago. And it's already been discussed here...
have you never heard of the term before
I don't understand why "vibe" coding became the term for that.
I think someone not in programming and comes into programming via route of vibe coding is a quite cooked situation
Y combinatorics used it I think
Itโs ceo
I have, I'm just surprised the notif came nit too long after it been referenced here
Did they explain what "vibe" has to do with "asking an LLM"?
tbh I might just try to skip day 1 to go to day 2 ๐
vibe is unjustified feeling towards something
I've never had to do these types of puzzles lol
the lack of reason is probably why
A guy said they had to "embrace the vibes"
In my usage, it doesn't have the "unjustified" connotation
They actually did like they were quite about how you enter into this state of just creative freedom some bs ๐ you know how sf peeps are
Or something to the effect
Yeh
And people started making fun of it, and it stuck
World was better without the word
"Vibe with the code" remains the single most SF engineer sentence ever uttered
True lmfao
itโs so SF
Bro
i prefer to be viscerally aware
Yeah same thatโs why I plan to never do drugs
I misunderstood the first question and I'm kinda rushed on time rn (i don't have a lot of free time ๐)
Not even once? /s
caffeine is a drug yknow
im about to give up atp ๐ญ
I've been trying to lay off the coffee lately
Bro come to the spoiler channel
it doesnt lock after 24 hours
My doctor wasn't appreciating the sheer amount I drank
yeah ig
Still had cappuccino today
And told me to just sleep better
๐
I have take my fair share of medication for anxiety stuff
๐ โ ๏ธ
They slow you down
Sometimes that can be a good thing tho
I've been getting crucified by uni lately,
It's hard to keep up with the sheer amount of demands, paperwork, and outings we have to go.
I'm pretty sure if somebody slipped in a document to sell my soul, I wouldn't have noticed
im currently trying to learn python as my first language, i'd like some help on how to make it so when you get the correct answer it sets a variable to a certain number, im messing around with the "set" command and nothing is working, any help? my code is:
variable = 1
answer = input("question with yes as the answer (yes/no): ")
if answer == "yes": print("Correct!")
and, print(variable)
else: print("Incorrect!")
Just do
if answer == smth:
variable = 8
To set it to 8
Like the way u did print
You can add more statements
ohhh
Hey @mossy sigil!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
variable = 1
answer = input("question with yes as the answer (yes/no): ")
if answer == "yes":
print("Correct!")
variable = 8
print(variable)
else:
print("Incorrect!")
Also please use multiple lines and also some syntax like used of and was wrong
you put different statements on different lines
With indentation with respect to if
Should I install a higher version than default on Debian if I'm doing jupyter?
Higher version?
Of what
Newer version of pythpn. It defaults to 3.13.5
oops wrong channel
I see well tbh doing it to 3.14 will not do much of change itโs not that big of a jump
but u can do it anyways itโs not gonna hurt but only give some additional features
Will it screw anything up if I do it later?
No
Itโs not that big of change
Go ahead
You wonโt even notice
OK I will just checkpoint the vm after I get jhub running. No point rn.
and also projects like jupyter and such shouldn't really depend on a specific version number exactly, if they want to be compatiable
GD ms hyperv can't even do copy paste enhanced mode
Also you can have multiple version of python on same system
If you need any
this shit too flexible
Yeah I know venv and such
Venv yeah
But as I said my priority rn is to get jupyterhub going
Yeah
But packages ma require
Certain versions which u need to comply with
What are you going to do I Jupyter
Many things. Mostly physics.
Which packages are you gonna use
I mean, I'm looking at prolly over 20
RN femm
Not really data science, except maybe opencv
I mean I would like to try new features but not a major priority
They are quite niche
To even use in daily practice
in many cases lmao
ever looked into parser-combinators?
also, what's your http lib?
!pypi sunsehttp
why is almost everything tucked away in a util package
it's for types
Hey guys, if i'm doing object oriented programming?And I make a class that has like x amount of attributes, x amount of methods how would I call that in my code?Would I just use procedural code with the classes that I already had made
A simple Python wrapper around llhttp, the HTTP parser for Node.js.
let me research into that
no
it's a C library that was built as part of the node project
it's what node uses to parse http messages
the api is very simple and ffi-friendly
util can probably be called http since it all looks like http stuff
oh cool
got it
Bro research into what
llhttp
BROO what
$ wrk -t4 -c100 -d10s "http://localhost:5555/add?a=10&b=20"
Running 10s test @ http://localhost:5555/add?a=10&b=20
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 22.92ms 1.08ms 28.64ms 95.81%
Req/Sec 1.08k 74.03 1.17k 96.05%
16332 requests in 10.06s, 2.77MB read
Socket errors: connect 100, read 0, write 0, timeout 0
Requests/sec: 1622.66
Transfer/sec: 282.06KB
$ wrk -t4 -c100 -d10s "http://localhost:6666/add?a=10&b=20"
Running 10s test @ http://localhost:6666/add?a=10&b=20
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.44ms 1.40ms 84.10ms 99.80%
Req/Sec 10.48k 138.76 10.91k 81.19%
421129 requests in 10.10s, 33.33MB read
Socket errors: connect 0, read 35, write 0, timeout 0
Requests/sec: 41693.69
Transfer/sec: 3.30MB
imo that is the power of llhttp
damn thats really fast
could anyone explain this about numpy.interp
https://numpy.org/doc/2.2/reference/generated/numpy.interp.html
I just dont understand why there are 2 datasets for x and y if its one dimensional interpolation, I also don't get the x argument, it says the x coordinate to evaluate the interpolated values but I also don't get what that means lol
the interpolated values are invented data points
the x argument tells you where (left to right) they should be
yeah i understand that part, I just don't see what these other datasets are important for
working on a http library is really fun actually
the one-dimensional interpolation means it only interpolates the y values
it doesn't interpolate the x values too
so given some x values, it gives back the corresponding interpolated y values
oh man i still am not understanding at all lmao
there is a graph defined by xp and fp
we want to find the interpolation for all x within that graph
which will be our answer, y
maybe an actual example would be better, i got this answer from stackoverflow for what im actually trying to do which is generate a 2d array of values to emulate the equator (working on a procedural map)
import numpy as np
x = np.interp(
np.linspace(start=0, stop=2, num=41),
xp=(0, 1, 2), fp=(-1, 1, -1),
)
xy = np.broadcast_to(x[:, np.newaxis], (41, 6))
print(xy)
i wont paste in the result cause its kinda long
i understand the fp part
those are the points to interpolate from
xp and fp are the points
i dont understand what xp is for, even thinking about i cant figure out what it actually dpes
what does 0, 1, 2 mean then
xp is the x values of the points, fp is the y values of the points
x=0, x=1, x=2
so we have points (0,-1), (1,1), (2,-1). Those are the data points
yeah
do you get it now?
ohh i think so
so it would be like
x: -1
x: 1
x: -1
as a visualisation of what this imaginary graph looks like
sure ig
sure... tho they are coordinates
btw I just read the docs, I had no idea what this function did before now
and fp is to say what those coordinates values are
yeah im a bit stupid with this stuff lol ive never done it before
took me a few mins to figure out
when i actually visualised this i thankfully figured it out
SMORG
experience points and functional programming
programmer rpg
SMOOOOOOOOOOOOOOOOOOOOOOORG
Learning to read docs is hugely useful. Essential in the long run. The numpy docs are extensive and usually have examples also.
And keep bookmarks in your web browser, makes things much easier to find later.
yeah i read docs quite often
i just didnt really know what i was looking at lol
Fair. Also, many docs are written by people who already know how it works or what it's often for. That can leave a bit of a conceptual gap.
SMORG
!timeout 1420208388200992780 1d spamming
:incoming_envelope: :ok_hand: applied timeout to @storm karma until <t:1764734414:f> (1 day).
@ebon owl why cant we send funny gifs?
ive noticed that, i tend to be confused with the docs until i lock in, sleep on it and just experiment with the code
a lot of times things get easier to understand once you start writing down some code
(same thing with math questions lol)
I think the rule was put on this channel because of how busy it gets in here. Gifs can quickly bury all text conversations that were happening. You can post them in the off topic channels as long as it's not too frequent.
this is python discussion after all...
Not Rust discussion?
all helpers+ drop your favourite python gif
also rust discussion
(chris don't smite me)
but non-sanctioned rust discussion
Speaking of ๐, I decided to test ty again
How is it
(core) @shenanigansd โ /workspaces/core (main) $ uv run ty check .
Found 25 diagnostics
way better than last time
Last time it found like ~1500 errors
I too like disabling linter rules
look again
I can't disable them
I don't know if they're valid
Real
All that tells me is that it's a mistake to write code
(if you hover on the (edited), it show a timestamp)

Off to a bad start
error[invalid-assignment]: Cannot assign to a subscript on an object of type `None`
--> src/core/batch_jobs/manageorders.py:60:13
|
58 | if sales_order.custom is None:
59 | sales_order.custom = {}
60 | sales_order.custom["manageorders-request-id"] = upload_response.headers.get("x-amzn-requestid")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 | flag_modified(sales_order, "custom")
62 | if "zendesk_tickets" in sales_order.custom:
|
info: The full type of the subscripted object is `dict[Unknown, Unknown] | None`
info: `None` does not have a `__setitem__` method.
info: rule `invalid-assignment` is enabled by default
mannn
OMG IT DOES HOW DID I NOT KNOW THIS
lucky 10000
IKR
unfortunately it only has the resolution of minutes
lol, I think the only valid diagnositic here is the one "warning"
error[invalid-assignment]: Object of type `list[StatementFilter | LimitOffset]` is not assignable to `list[StatementFilter]`
--> src/core/web/wms/items.py:63:18
|
61 | ) -> OffsetPagination[Item]:
62 | """List items."""
63 | filters: list[StatementFilter] = [limit_offset]
| --------------------- ^^^^^^^^^^^^^^ Incompatible value of type `list[StatementFilter | LimitOffset]`
| |
| Declared type
64 | if name:
65 | filters.append(ComparisonFilter("name", "ilike", f"%{name}%"))
|
info: rule `invalid-assignment` is enabled by default
class PaginationFilter(StatementFilter, ABC):
@dataclass
class LimitOffset(PaginationFilter):
list[T] is invariant in T
What
?
I don't know what that means
I need to wrap it in type[] to allow subclasses?
Wait
aight bet ty @ebon owl
Hol up
(core) @shenanigansd โ /workspaces/core (main) $ uv run ty check .
info: Element `LimitOffset` of this union is not assignable to `StatementFilter | ColumnElement[bool]`
info: Method defined here
--> .venv/lib/python3.14/site-packages/advanced_alchemy/repository/_async.py:1656:15
It's searching the venv lol
uh you can TypeVar with a bound=SuperClass but i forgor what the new syntax for that is
is this mypy btw
no
mypy --strict already runs in CI on all my repos, so they all pass
Oh wait no it's not
I'm dumb
I didnt see the whole message
That's just the hint showing me the definition
sigh
Gotta love when the framework's examples don't pass the type checker
maybe you just need a stub?
no
error[invalid-argument-type]: Argument to bound method `list_and_count` is incorrect
--> src/core/web/onsite/designs.py:64:60
|
62 | ) -> OffsetPagination[OnSiteDesignSchema]:
63 | """List designs."""
64 | results, total = await designs_repo.list_and_count(limit_offset, order_by=(OnSiteDesign.number, False))
| ^^^^^^^^^^^^ Expected `StatementFilter | ColumnElement[bool]`, found `LimitOffset | LimitOffset`
65 | type_adapter = TypeAdapter(list[OnSiteDesignSchema])
66 | return OffsetPagination[OnSiteDesignSchema](
|
info: Element `LimitOffset` of this union is not assignable to `StatementFilter | ColumnElement[bool]`
info: Method defined here
--> .venv/lib/python3.14/site-packages/advanced_alchemy/repository/_async.py:1656:15
|
1654 | return statement
1655 |
1656 | async def list_and_count(
| ^^^^^^^^^^^^^^
1657 | self,
1658 | *filters: Union[StatementFilter, ColumnElement[bool]],
| ----------------------------------------------------- Parameter declared here
1659 | statement: Optional[Select[tuple[ModelT]]] = None,
1660 | auto_expunge: Optional[bool] = None,
|
info: rule `invalid-argument-type` is enabled by default
Expected `StatementFilter | ColumnElement[bool]`, found `LimitOffset | LimitOffset`
Again, LimitOffset is a subclass of the StatementFilter metaclass
Also not exactly sure where it's getting LimitOffset | LimitOffset from
!rule ad hire paid
6. Do not post unapproved advertising.
9. Do not offer or ask for paid work of any kind.
have you guys switched from pip to uv?
yes
๐
i did a couple weeks ago and it has been fun
uv and marimo now, instead of pip and jupyter notebooks
up until a few weeks ago yes ๐ฎ
Tbh I still like raw pip
I bet that was a big culture shock
It has it's uses
But I have definitely outgrown it
Bast have you seen my deps?
everything that i work on is a one/few-person project so i'm a bit isolated from what the whole community is doing
all i know is it just feels nice
i can't say i minded using pip before either
but uv feels cool and fun
I've still been using pip
One of the only benefits uv brings for me is it manages the python install and venv automatically. That has cut so much friction for other devs jumping in and out of projects. ((I don't mind the simplified nox sessions either, but they worked with or without uv))
You almost need a TLDR uv vs pip message pinned lol
main benefit imo is itโs screaming fast
If I'm measuring a tool's benefit by speed alone, I question why we need the tool at all.
You use uv inside nox, don't you?
I set nox.options.default_venv_backend = "none" because I want to manage my Python install in one single place so I do uv run nox



