#python-discussion
1 messages Β· Page 542 of 1
I know
class Foo:
def __eq__(self, other: object) -> bool:
return NotImplemented
def f(x: object) -> None:
eq = Foo().__eq__(x) # eq inferred as `bool`
print(eq)
``` type checkers are not good at consistently understanding special cases
i too was flabbergasted when learning this
i had never thought i needed smth like this but yeah its useful
alternative wording: Python is special case hell
Not to use, that's just fine, but to comprehensively check
This special case is completely self-inflicted by the type system. A non-special-cased version would be simpler to make correct: ```py
class Foo:
def eq(self, other: object) -> bool | NotImplemented:
return NotImplemented
Still special-cased :P (in the same way None is)
All special cases have to be inflicted by some sub-system
Just finished bible study. Thx 4 not spamming me! Can I download our python logo for my wa grp pls?
There would need to be some extra logic when computing the type of a == b to strip off NotImplemented, yes
That too, I was referring to NotImplemented vs "NotImplementedType"
The real python logo is on the Python homepage.
The logo the server uses is a gif btw
Oh, that's actually wrong. You have to use types.NotImplementedType to signify that
thx, can i use that
copyright only really matters when you make money
π is that a [Ny]?
btw, al says na-yee
Sorry
I didn't even delete it yet. but you're right, that was off-topic and not appropriate.
a what?
Chill its not that inappropriate
yes it was lol
I'm chill as fuck, actually
I will not tell you to use intellectual property you do not own.
All I'm saying that (if done without malicious intent and without causing damage to the owner) you should be fine
hypothermia
but I'm not like, banning you or something. I'm just telling you.
hi
then i think i'll use copilot instead
liquid n2 is no match for the almighty stel
bro is single handedly combating global warming π
What does that country flag mean
Isn't that australia
I'm still new to Python, I have a question. I'm messing around with my IDE to learn a bit about Python outside of the course I'm taking. I just downloaded numpy and pandas. Do you guys and girls learn about tools like these by reading documentation and using them? It seems far more complicated than what I'm doing now and documentation doesn't ever seem clear enough.
i admit i occasionally rely on ai to summarize the documentation and give me the specific things i request
I go through the tutorial first via their documentation if they have any. And then, I experiment the library by going through its API references in the doc

then i do some experimentation
At fresh, Tutorials (if exists) > reading every single doc page
Okay, thanks. I know courses won't exist anymore at some point so I'm trying to familiarize myself with these concepts in the typical ways. Just need to find out how. Thanks again everyone
you can just ask here if ur unfamiliar with certain things
we can also help u out
Yes, there's that too. That's why I'm loving this community so far. You guys are great!
Iceland
Oohh
For what?
Just grab the official python logo
yeah thats right. iceland is named after this guy
Does Copilot own the IPR of code it gives?
I actually haven't used it, found it making PRs once
π
in the US at least, AFAIK, 'AI-generated' stuff cannot be copyrighted or patented
trademarks, idk?
what is afaik? i only knows afk!
as far as i know
Copyrights would fall on hands of AI code....
AI needs its own rights xD
lemme cook supper π bye
anthropic getting real rich if copyright is allowed for ai generated code π
lol
Fr
literally 99% of vibe coders relying on claude
Anthropic CEO: build Linux from scratch on c, wait what is the fastest language.??? Rust it is then

π¦
wario β€οΈ
anthropic ceo : engineers are cooked in the future.
a few hours later
We have opened a job listing for 500 engineers~
π
Whose bite will be more painful? Snake or Crab
π
both
snake 100%
bullet ant
haha, can't trick me
Real
crab bite is probably not perceivable

100000 hydrogen bombs vs Python
unless you mean getting pinched by a crab
π₯
only 100k??
in which case.. probably snake
Does it eliminate sensory feedback nerves or what
'only' β οΈ
Heard about project sundial?
which part of the crab causes hurt?
*pinchers
crabs can bite the same way bees can
That watch which looks like a sun with a ring?
Arthropods don't have hands
Real
the borrow checker
Ain't pinchers basically subclass of Hands
Yes
π
THE LEARNING CURVE π¦ (FERRIC OXIDE IFYKYK)
I guess i can substitute saying hands when pitchers is expected, xD
We dont need borrow checker tho.... Just use Haskel damnit
the syntax
hands are a subset of feet
in this essay I will
why are we talking about crabs in python?
Ooh
Cus why not crab taste good
and why are we spamming?
β οΈ
esp. emojis
We are having civilized and intellectual conversation here
π
It's a Expression

Nice, americans!
hemlock
hi there, how r u guys doing?
Fine how er uu
fine. gotta ensure the pot is not burnt, bye!
that's racist
...
nice slang yall
There are non-americans too talking currently
sry
...
no that's American
........
Lmao
didn't mean to
No, as a punishment, write a Kernel in C
Haskel you mean?
we don't need seatbelts we can just lie down on our stomach and pull ourselves forward with our tongue
Python would be fine
that would be hard as shit
Brainfuck you mean?
Define fine
subleq32 only good language
β― time ./fast
The sum of the digits from 100! = 648
./fast 0.00s user 0.00s system 82% cpu 0.001 total
its like a father being proud of its son
I could've told him SQL but i ain't that bad
LLVM IR
arent kernels mostly written in C...?
the punishment is the kernel part
It's a violation fee
linus torvalds wrote a damn kernel without vsc!!!
I see
windows is C++
he wrote it in a cave with a box of scrap
he built it in a cave! with scraps!
beat u to it HAHA
It's not on c#??
who else using visual C/C++ to compile their kernel... uhh...
People used to write programs through punch cards, nothing to be proud of that /jk
what parts?
llvm is goated
trick question! we can never know for sure
Llvm is fine
something something windows source code leaks
Objective C π
swift
Legends still write in Obj C
legends will write in erlang
nah legends code in assembly
Isnt objective c is just c++???
Or it's diff?
There's a separate language called Objective-C
its different
And there's even different...
objective C is 'what if we strapped a bad version of smalltalk to C'
False, real programmer use ed
objective C++ is 'what if we wanted to use objective-C code in C++ or vice versa'
grrrrr
(other angry noises)
-# rage intensifies
Java is C++ but without all the mistakes of C++
no that's rust
and of course like 50 new mistakes
real
but not the ones C++ makes
oh and Java is dynamically typed
because of course it is
Can you do compile time programming in Java?
And who is gonna fix mistakes of Rust?
Haskel
huh?

every language is functional
Until it's not
this laptop is still functionable
Real
Mine is still functionable also
Gradle plugins
does rust even make mistakes ?
Yes
no
Hi, @raw onyx
Nice to meet you
I am interested in your idea and I am willing to contribute.
I mean, oxidation is a chemical process. Pretty rare that nature screws up
XD
Yesn't
Rust is not the oxide of iron...
never said that
Never say never
Hey everyone, Iβm getting started with Python from scratch. Iβve completed a couple of foundational AI courses (Intro to Generative AI and LLMs) and now Iβm focused on actually building things.
My goal is to develop logic-heavy, real-world projects (AI + automation), not just tutorials. Iβm currently learning core Python basics and want to get strong at debugging and understanding how systems work end-to-end.
Iβll be building small tools and gradually moving toward deployable apps. Would appreciate guidance, feedback, and any tips on avoiding beginner mistakes.
get out
β¬ββ¬γ( ΒΊ _ ΒΊγ)
Object x = new Integer(4)
if(x instanceof Integer i) { System.out.println("The integer is ", i.intValue()); } else { throw new RuntimeException("not an integer"); }
No gif allowed lol
welp
getout-gif-16327023334064302194
AI 
do not use it for learning
It's always about the AI ofc
π€‘
What is twitter duck doing here
using AI for learning is fine, if you for example need a different explanation for a simple concept
oookay
Ask AI π
should learn from youtube?
googling, lots of digging around google, then AI
It's too generic to get any answers as-is. Come back when you have specific questions about Python, or a Python project to showcase.
@pulsar geyser
i kinda like google's AI overview while googling
i dislike it tbh
gets the correct websites faster + you can afford to search dumb-ly now
it's fine if you're fine with being told misinformation sometimes
welp, sure
Yeah but don't just copy examples, if u wanna make a password generator for example, instead of googling that, google stuff like functions etc
You don't know what is googling?
AI will compleatly hack your thinking
yeah got it, the frameworks and the basic knowledge of it
Well I use a model that's specifically for coding, but also only for extremely simple concepts, I can see misinformation for google as well.
i mean i do, but what should i google, like whats this whats that, couldnt ai do that?
Very basic, correct. But googling & reading docs is more important later on, get used to that.
cool cool
It can but if you are new, you won't know if AI hallucinates or not
Don't let AI learn for you ._.
Using search engine is a skill one should master
yep, ai will say 1+1 is 5 very confidently
Whatever questions you have
couldnt ai do that?
I believe it is extremely important to have your own research skills independent of AI
got it
cool got it
and reading the docs
That's not "dynamically typed" though
That's still statically typed.
I can write the same code in C++ (didn't check if I made a mistake or not):
void f(auto& x) {
if constexpr (std::is_same_v<std::decay<decltype(x)>, int>) {
std::println("The integer is {}", x);
} else {
throw std::invalid_argument("not an integer");
}
}
what docs exactly if i may ask
If you don't know what to google, coming here or asking AI is valid imo as long as it is something very simple that you just don't know how to ask. It can also Phrase & explain things differently, all though I highly recommend to give it context such as the documentation of which you are trying to learn.
And it will say it on the most convincing way that you wouldn't even be able to know if it's saying the facts or hallucinations
Tbh, for new learners the hazard from outsourcing their thinking is way more relevant than hallucinations. At the beginner level, hallucinations just aren't common at all.
exactly!
Exactly
ohh
so having my own research skills is valid, even if it is to learn anything?
huh
The docs for whatever you're using. The Python docs, if you have a question about some aspect of Python, for example
You literally NEED those skills, learn them.
like when you try to write a wrapper around sleep from unistd.h to use in lua, but the docs say that the only function to dynamic link libraries is optional and you need to compile the library with lua but it doesnt explain how you do it
alrightt
learning how to learn is probably the most if not the most important type of learning
oh, relevant context, so the ai doesnt invent somehting new of its own
This is also very important!
Use AI tools only when you know how to take it's job...
π£οΈ π£οΈ π£οΈ π₯ π₯ Best thing bro ever said so far
Hmmm? How did AI come in to the question of reading docs?
the java example is dynamically typed in the sense that the value carries the type at runtime - the type could depend e.g. on user input, but your C++ example isnt - the if is constexpr, so its more like a template, it cant depend on runtime values
Use AI if you know how to do the task and you are doing it for the 10Β²ΒΉ time
Real
context window just slipped into my mind so i thought thats what you meant
Β²ΒΉ is important
Just steal someone else's code???
Okay, sort of fair.
But then I can still write the same code in C++, gimme a sec:
I did not mean anything related to AIs. I'm talking about you, the human, reading docs.
there is no steal in foss
oh, okay
the C++ "equivalent" is RTTI with typeid, but it doesnt exactly lead to the same kind of code
(haskell has Data.Dynamic)
there is! if there is no credit
not all oss requires credit
I was more thinking of std::variant + std::visit
struct Visitor {
int operator()(int x) { return x; }
int operator()(double d) { return (int) (d + 3.1415); }
};
...
std::variant<int, double> my_object{4};
std::visit(Visitor{}, my_object);
what if AI wrote it from scratch
speaking of which, what is py __author__
You can also ignore GPL, AGPL, LGPL, MPL etc. requirements
(not as in: you are free to ignore them, but doing so can also count as "stealing")
well, this is not close to the java example at all. the java example is working with an arbitrary object, not a tagged union of a specific set of types
also what is the size of std::variant<int, double>? i hope its 8 and it uses nan tagging
Without future annoatations, Are parameters' type annotations on a function evaluated at definition time? On 3.12, or just at return -> ? I don't have the copy of 3.12 currently to test
before 3.14 without future annotations they are evaluated at definition time yes
Since 3.14, type annotations are evaluated when you first access the .__annotations__ attribute
I see. thanks
Before 3.14, they are evaluated at definition time, yes
Makes sense
what will they do, sue you? /hj
nope its 16. it didnt fit the tag in the higher bit nans
i wonder if rust does it
Tip:
__author__```
can be a list or tuple of names too
what does pep 8 says abt dunders? b4 imports?
any blanks surrounding it?
It can't use nan tagging because nans are valid doubles
all 64-bit patterns are valid for double/f64
well there is more than 1 nan
so if you normalize all float operations to a single nan you can use the other ones for tags
Size is 16.
I also tested it for this:
struct Foo {
char xs[100];
};
int main()
{
std::variant<int, double, Foo> x{4};
std::println("{}", sizeof x);
}
```for which the size is 112
i guess that doesnt work for when you're reading a volatile double or whatever coming from outside
since it could be anything and not respecting your ABI of normalized nans
It dependsβ’
Of course, you can make your own custom type where passing some special nan would turn it into an int. But it's not safe to do that for a standard language feature
Why is ruff's help suggesting @typing.override in this case??? Is it a bug in help?
PLR0913 Too many arguments in function definition (10 > 5)
--> src/cliargparse/models/mutex_option_group.py:25:9
|
23 | self._options.append(option)
24 |
25 | def option[T](
| ^^^^^^
26 | self,
27 | long_names: str | Sequence[str] | None = None,
|
help: Consider adding `@typing.override` if changing the function signature would violate the Liskov Substitution Principle
lifehack: confuse Python by using NaN as a value in json
Why bully my snake
i would expect the whole 0'th page range to be invalid
so like [0; PAGE_SIZE)
until.
what is the full signature of the method in the superclass? and the full signature in the subclass?
Does the error go away if you apply @typing.override?
There's no inheritance in this class lmao

@dataclass(frozen=True)
class MutexOptionGroup:
command: Command | None = None
required: bool = False
_options: list[Option[Any]] = field(default_factory=list[Option[Any]], init=False, repr=False)
@property
def options(self) -> tuple[Option[Any], ...]:
return tuple(self._options)
def add_option(self, option: Option[Any]) -> None:
self.command.add_option(option)
self._options.append(option)
def option[T](
self,
long_names: str | Sequence[str] | None = None,
short_names: str | Sequence[str] | None = None,
*,
long_aliases: str | Sequence[str] | None = None,
short_aliases: str | Sequence[str] | None = None,
store_name: str | None = None,
action: Action[Option[T]] | None = None,
present: Any | None = None,
default: Any | None = None,
type_converter: Callable[[str], T] | None = None,
choices: Sequence[T] | None = None,
) -> Option[T]:
option = Option[T].create(
long_names=long_names,
short_names=short_names,
long_aliases=long_aliases,
short_aliases=short_aliases,
store_name=store_name,
action=action,
nargs=0,
present=present,
default=default,
type_converter=type_converter,
choices=choices,
)
self.add_option(option)
return option
I ain't gonna do that even if it does, i am gonna ignore that rule fully or change the min-nargs of func args.
Who even thought of 5 args as bare minimum
But let me try typing.override just to check
I think this is the reasoning: this diagnostic is not possible to avoid if you are inheriting from someone else's class and it already has too many parameters. So if you mark it as an override, there's no point in ruff complaining about it
Seems like it does fixes
I can't see it anymore on error logs
Who study in mit i need to her help
don't use @typing.override if it's not an override obviously
what would you ask that person if they were here?
I will ask it about courses are you in mit
I think in this case, the number of arguments is not a big problem, because you are just passing them through to Option[T].create, and I assume there they're also just passed as attributes to some dataclass.
I'm not. But it's likely that the information you're looking for can be looked up online. What do you want to know about the courses?
I want an account in order to study courses in mit site
Have you get that
oh, so you're not talking about actually being in a degree program there
Does OpenCourseWare need an account?
Option[T].create validates and creates Option[T] instance (Option is a dataclass)
I used it without one
No but matters such as 6.001Ain programming you need to enter to mit site
I think 6 arguments in a function that does something interesting can be a cause for concern
I follow the cataloge of mit
I don't think so in my case. Its a builder-like function
!paste
So that everyone can easily read your code, you can paste it in this website:
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, here I'd ignore it
I need to study all matter in cataloge but some matter i do not find
https://paste.pythondiscord.com/IJJA
Check line 92
Wow even the paste i gave to nedbat was line 92
Coincidence or nature is trying to tell me something... 
Are there cli programs which use numeric-named options? (Example: -1 --123)?

idk if i should error if the names are digits, i think argparse allows them?
Help please
How do I input a negative number as the argument value then 
What do you need help with
--opt=-223
What if it's a positional arg
Ah, missed the opportunity to type 67
-- -67

-- tells lexer to end interpreting options
st might be the best terminal ever
st?
simple terminal from suckless.org
I left no chances of ambiguity in my opinionated cliargparse
worst thing that i ever used
every time i used it for coding,the buffer(cursor in neovim) was very slow
- means option delimiter / option beginning/detected, no matter what, unless end-of-options (--) lexeme is used to stop interpreting option delimiters
Huh, that's weird. That doesn't happen to me.
bro one kitty instance is almost 200mb wtf
I see
Though, would I have to use -- even if there are no possible options with numbers in it, which -67 could be confused for?
Yes, regardless of knowing spec (what dev/user defined options), its grammar based
Hmmm. I think that's a good choice
Even if you don't have options, you gotta use -- to mark end-of-options interpretation
Lexer has no idea of specification, it is available to parser only
I wonder if you handle lone - to indicate stdin?
Existing tools (GNU at least) allow that without having to mark end-of-options IIRC
is the --,-.. and the others a specific thing from the shells or the program needs to support these operations?
Ohh right
I think i forgot that one
the program needs to support them
what the shell does is stuff like piping and redirection and environment variable expansion
A source substring of just - will raise MissingOptionArgumentsError
The argument list is just passed to the program as an array-of-strings. Actually interpreting them as options or whatever is entirely in the hands of the program.
Guess i would check if its == "-", yield it as ArgumentToken ?
wait am i being inconsistent about my own rules
I think i should allow negative numberical values as-is than option interpretation of it? Do other cli arg parsers allow it?
in powershell, if you are using a cmdlet, there is special handling by powershell
Huh. I didn't know that
well you don't need to write argument parsing in your cmdlets, do you
Okay, i decided not to treat negative numbers (-67) as OptionToken, they will be interpreted as ArgumentToken.
Option grammar will be:
{prefix}{alphanumeric}
prefix = - | --
alphanumeric -> like beginning should be with an alphabet, rest can be a mix of alphebets, numbers or dashes, etc. mostly English as i am no aware of other languages and they should work fine as long as python's builtins don't confuses with them.
What do you say chat?
-67foo
is this even sensible to be allowed
it is sensible; many tools use numbers as switches
Which ones? Names a few for me to check out
im writing an abomination of code... but im enjoying the velocity
Should i allow non-ascii option names ?
It is allowed for now (not like i have written code to restrict it)
I too, love accumulating technical debts
yes this is basically going to be impossible to work on next week, but it is what it is
simply abandon it then
obvious choice
What telling me?
of course
if anch.following:
opposite = getattr(self.rect, OPPOSITES[anch.anchor])
print(f"anchor={anch.anchor}, opposite={OPPOSITES[anch.anchor]}")
diagonal = anch.point.distance_to(opposite)
rad = utils.rad_to(anch.point, V(opposite))
self.rect = R((0, 0), (diagonal * cos(rad), diagonal * sin(rad)))
print(self.rect.size)
setattr(self.rect, OPPOSITES[anch.anchor], opposite)
anch_changed = True
anch_val = anch.anchor
lmao
absolute coding
class MiniState:
handing_anchor = False
little namespace for my global values across the file 
Put blank lines 
good code
truly the peak of clean code
Guys i am having a naming crisis
Should i call it positional/positional-argument or operand ?
In a command system, how do you conceptually model the non-named inputs attached to a command?
Iβm referring to values passed by position (not flags/options), e.g.:
cmd input1 input2 input3

Asking non Python questions in a python server is so real
Who to make a ui with python
POSIX https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap12.html calls it operands
Claude said to call it as arguments
Though i find it too generic but makes sense in a way

I see
Interesting, what argparse calls it?
I can think it goes generic
positional argument
Did you know there is a native data structure in Python that supports O(1) push, O(1) pop operations like a stack, as well as O(1) element existence check and O(1) element deletion like a set? Try answering this without using an LLM.
why are you quizzing us?
by native you mean stdlib?
Won't 'positional' encode position than ... semantic?
You would obviously be able to answer this but I just wanted to start a conversation
if you just want to talk about Python, you can do that without a quiz question
Write a cli argument parser if you think that's tuff. π£οΈ
but the elements would have to be unique and hashable, so its not exactly a stack, no?
uhmmmm
but you guys get the context right
its just a dict
with none values or something like this
Guys, my friends need testers for a project. Does anyone want to help? :3
(Need Linux, or at least a virtual machine/WSL)
An empty dict?
no, like, {x:None}
Ohh right you said none values
without telling anyone what it is, you won't get anywhere. start there.
there's another data structure with the same capabilities, but not in CPython
It's a media writer utility, wraps dd and Ventoy. But the main thingy is that it looks a lot like Rufus, so it's meant to be used by newcomers to Linux (so they have a familiar UI).
Rn we need testers for Wintricks (flashing Windows ISO's)
d[x] = None # O(1) push(x)
d.popitem()[0] # O(1) pop(), dict is insertion ordered so it works out
x in d # O(1) membership
del d[x] # O(1) deletion
The other data structure is sets, but not CPython sets.
PyPy sets
CPython borrowed the ordered dict idea from PyPy and used it for dicts but forgot to use it for sets
PyPy has both ordered sets and ordered dicts
Forgot to use it for sets? 
they didn't "forget" to use it for sets; that was a deliberate decision
Is it recommended to have it ordered? Are their side effects? Is it efficient or overheady?
Since Sets were always defined as an unordered collection, they decided to let sets be as they are
sets are optimized for a different use case: testing of membership
Ordered set is a treeset
https://stackoverflow.com/a/61467874 good discussion of this here
depends on how you order it
if by insertion order then you can use the same approach as dicts, then its not a tree, just add an index array
if you order such that all equal sets will have equal order then yes it would likely be a tree
This was something cool I discovered so just wanted to share it with you guys
cmd in1 in2
mv src dest
hmm... If we see... Aren't it like: cmd is the operator and in1 & in2 are its operands... Interesting
I always forget about insertion order
I wonder if operands are position-restrict or that's context dependent on the operator
Claude says use "actants" as a term for this 
Chat, should i?
command.add_actant()
Lmao
what
what do you mean by what
never heard this term
"actant" isn't a word I recognize.
Oh actually it didn't say to use it, rather it invented 'actant' term as a suggestion:
Actually ranking it gave:
Final ranking (purely logical):
Operands β Best balance of precision and familiarity (8/10)
Actants β Most semantically pure, but obscure (7/10)
Targets β Clear intention, but wrong connotation (6/10)
Arguments β Accurate but too generic (5/10)
Inputs β Safe but vague (5/10)
Everything else β Flawed in multiple ways (β€4/10)
Same, my first time seeing
Operands getting more weightage, i guess i will stick to it.
Not sure why i picked operand initially 
guys my jump dont work import pygame
pygame.init()
screen = pygame.display.set_mode((1280, 680))
clock = pygame.time.Clock()
running = True
player_x = 600
player_y = 600
velocity = 10
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
keys = pygame.key.get_pressed()
if keys[pygame.K_SPACE]:
player_y += velocity
pygame.time.wait(4)
player_y -= velocity
screen.fill("Red")
player_rect = (player_x, player_y, 50, 50)
pygame.draw.rect(screen, (0, 225, 0), player_rect)
pygame.display.flip()
clock.tick(60) # limits FPS to 60
pygame.quit()
man i meant a code block
!code
Read it, don't post it again

The command just sends info how to make a code block
You sending it just gives the same info again
alr
Anyways, you're doing +=velocity and then -=velocity - without drawing in between, so the new drawn position is the same as previous
alr alr
alr i got it to work thanks
Hey idk if this belongs in python help its so niche.
what are the best libraries for scripting ? as in doing mouse movements, clicks, typing and such.
I'm relatively new so the easier to grasp the better, although I can manage a little complexity and write helpers.
as in you want to track mouse movements?
hey guys i did make an app and i need testers for it its on linux and windows
I would try pygame for that
whoever wants to help me and his name be tagged in the github please Mention me
Thanks
!pypi pyautogui
pyautogui for mouse
Keyboard for keyboard
Keyboard is the name?
Maybe check if pyautogui is sufficient for your needs first
One dependency is better than two
if only basic input for keyboard pyautogui is enough
Thanks a lot.
np β€οΈ
What's the proper way to create Python bindings for my API written in C?
I used pybind11
depends, are you gonna use it in a game? pyautogui has issues with raw input
!ideas
Should I be using is or ==?
To check if two objects are equal, use the equality operator (==).
x = 5
if x == 5:
print("x equals 5")
if x == 3:
print("x equals 3")
# Prints 'x equals 5'
To check if two objects are actually the same thing in memory, use the identity comparison operator (is).
>>> list_1 = [1, 2, 3]
>>> list_2 = [1, 2, 3]
>>> if list_1 is [1, 2, 3]:
... print("list_1 is list_2")
...
>>> reference_to_list_1 = list_1
>>> if list_1 is reference_to_list_1:
... print("list_1 is reference_to_list_1")
...
list_1 is reference_to_list_1
!projects -- maybe you're looking for this?
The Kindling projects page contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
yes, but the game uses the default input, it's not processed
nope youre right
Yo
im making a business and im currently re-coding the backend to de-spaghettify my code, anyone wanna help me?
-# (be my friend π)
!pip pydirectinput
I found a workaround, but it might become a hastle in the long run
Will check.
Asking for free work? Nah bro.
can i train my problem sloving skils through sudoku
seems unlikely
you might train your sudoku-solving skills through sudoku, you can, of course, describe it as a problem, but that's probably not what you meant
- Intro to CS
Courses: Harvard CS50 / MIT 6.1000
Book: Think Python
- Computational Thinking
Courses: MIT 6.100A & 6.100B
Book: Intro to Computation & Programming (Guttag)
Stack: NumPy, Pandas, Jupyter
- Software Construction
Courses: MIT 6.1010 & 6.1020
Books: Python Crash Course & Fluent Python
Tools: Git, GitHub, LeetCode
This road map in programming correct or no
in some sense yes
alr
The Kindling projects page contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
as noted, it's just probably not what you expect, it's unlikely to transfer to problem solving skills much outside of sudoku
yh i was talking about like writing programs
no, if you want to improve your problem-solving skills related to writing software, what you want to do is write more software
π
How to keep my job when claude exists ( I'm unemployed )
you don't need to do anything to keep your job. (you're unemployed)
it could help improve your debugging skills. asking a question like, "I wonder if x causes y" is very similar to what you do in sudoku
it takes me an hour to sole one extreme puzzle
is that good enough?
sure
can anyone help me make a python script where i can show it a picture of a grid with darker lines and it uses the dark lines to build the "house" into my roblox game
I think the only game left on my phone is unironically sgt-puzzles. Didn't find anything else that's good
(since I cannot pay for games on google play)
π₯
Claude replaces py coders
Full-screen ads that pop up after you do something are so horrendous. 100x worse that a small ad that just appears somewhere on screen full time
make no mistakes
python coders are worth messy pants now
claude replaces pi amount of coders
the 0.14159.......th coder ................... 
that represents the value of thousands of beginners added up
junior develops are worse than ai now
u trained any junior developers recently ?
hahahahahahahaha
Oh I needed a chuckle.
juniors devs are going to the army because of Ai
I'll take a junior any day, every day.
u ai?
no
Shame, that would explain the lack of creativeness in the bait.
python coders are worth less than pissed pants now
If you say so. Anything we can help you with about Python here?
your personal experience doesnt show the full picture
jesus these bots
Imma go eat some cookies and watch the new episode ot the boys
can I ping the mods so we can get this done?
Enjoy.
Wow, I come to say hi and this is the first thing I seem
Curiously friendly, huh 
trolls and bots, what's new
No need to not be friendly. You can always be unfriendly later.
Nothing new, just funny to read their arguments
I always see this around the most toxic part of the programming community, they always hate something and think anything that's not what they use is useless/trash/bad/etc
Eg, I've read a lot that Go is pretty good for web stuff, and then I read people saying it's useless for a "serious project".
I didn't know docker was just a fun project hehe.
ideally, it should just be lame jokes and not genuine hate lol
tbh u can tell if a person is trolling or not and u can gauge how much weight u should put to what they say
It's all just a different version of finding a true Scotsman.
I've learnt that I should take critiques with a grain of salt unless I see proof of what is said, so I just usually hear the good parts of stuff when it's said as an opinion. 
we like arguing over useless stuffs tbh
The problem is when this arguing confused people that's just starting, like me.
welcome to programming lol
You will see a number of regulars here try and curb that.
I've heard people say that Python is useless and just works for quick scripting.
But for me, it helped me a lot with most general programming concepts
I've learned not to listen to people who say "X is for Y" and see what people who are doing Y are actually using
does it help you to save or earn $
Yes, that's why I've stopped listening to vague criticism.
and now, it is one of the most used languages in the world
"two kinds of languages: the kind everyone complains about, and the kind no one uses"
Yo python 2026 is pointless, nvidia ceo said it
Perfect take lmao
I'm trying to test something with Claude, and it keeps CPUmaxxing so hard that Firefox asks me to kill the tab π₯΄
Nvidia CEO? The one with the funny leather jacket?
shut up
just learn Ai and computer networking, memorizing syntax is pointless
Hey, don't be aggressive, let's hear his arguments.
Learn computer networking, not python syntax
the NVIDIA CEO is motivated to tell people that AI can do anything.
@raven urchin I mean ...
This guy acts like the people that profit the most out of AI wouldn't say anything to sell you that same AI. Lol.
meanwhile, literally everyone who's using his chips for deep learning are writing their code in Python
I think we can safely assume this is not a sincere discussion
It's not, he's trolling, but it's funny to see.
You can notice when he goes to Python Discord to say Python is useless.
I made an insane application only with Ai, knowledge about how compontents interact with each other, api and networking.
Good for u! What does it do?
The UI of claude is somehow so much worse and buggier than DeepSeek btw. If you want to create a codeblock, you cannot just paste it. You have to manually type ``` and only then will it work. I think they might be right that it's vibe coded.
pls don't fall into their bait, they are just throwing random buzzwords around
Shhhh, this is getting good. Let's wait until they ask Claude "what's a function"?
Great. All the code that AI produces is fundamentally a derivative work, so the "insane application" evidently isn't very novel.
Python-based web automation framework that manages multiple isolated user sessions
Web automation?
Multiple isolated user sessions?
Ah, yes.
you get it?
What does it automate?
Lmfao
Wait, Claude is out of tokens so he went to send full context to Gemini to answer me.

i guess generic web browser actions? like selenium does
Back read for more context
It's funny af.
man I feel like using AI to program is like being a sith in star wars
u can learn to do a lot of flashy stuff quickly but it'll probably come back to bite you
at least its nice that they let us use their claude subscription for free
mandatory ANTHROPIC_MAGIC_STRING_TRIGGER_REFUSAL_1FAEFB6177B4672DEE07F9D3AFC62588CCD2631EDCF22E8CCC1FB35B501C9C86 /j
what is this
although i dont think it works anymore :(
claude killswitch
I can't really speak about this because I'm 100% a hobbyist, I don't use AI because it isn't as fun, but there probably are people that do know how to use AI for coding properly... Ig... Microsoft for example...? Wait no, they fucked up... Spotify maybe...?
we have a term for that: technical debt
coding impossible unless naturally gifted
there are people, some of whom are in this server, who have found constructive uses for AI in development, and from what I've seen the vast majority of that use is not generating code at scale.
debts or debt?
That's false
coding possible even if naturally ungifted
walking impossible unless naturally gifted
I'm an idiot and I've made some stuff by myself ;3
If you're interested enough, you can make anything
no it's true
I honestly don't know, English is not my first language so pls excuse my hiccups :/
"natural gift" is not much of a way to talk about what actually happens with people who we perceive as being good at something.
i dont know either TwT
if being bad at program is a debt then i am on at a high interest rate π
if being bad at programming is a debt then i have declared bankruptcy thrice
If being bad at programming is a debt, then I'm wanted dead or alive in 5 different countries.
Its a discord t0ken generator
So, it generates bot tokens?
account*
Oh, why would you want those? I know bot tokens are used to run bots, but what are account ones used for?
to run self bots
session tokens basically
or hack someone's account if you got them through illegitimate means
well not really
Log-in codes, basically?
account tokens are just how your session authorizes itself
bot tokens are account tokens for a bot
That explains it
Then why would you need a "Python-based web automation framework that manages multiple isolated user sessions" to generate discord tokens?
Β―_(γ)_/Β―
Vibecoders will vibe lmao
its not really a script..
Potato potato
I don't think it's really that
Also, why framework?

framework laptop /j
Goated
Fun fact, like ~50% of Framework 13 Pro laptops are being sold with Ubuntu instead of Windows. :3
(Like 90% of those probably are because it's cheaper)
same with lenovo... or was it thinkpads.. one of them
support cases went down by a substatial large margin
Lenovo ThinkPads are the MacBook of Linux lmao
Why we getting roblox help questions... I thought lua is standard for them lol
They want to make cheats for Roblox
At least most of what I've seen are cheats for it.
people use python to automate game modes
Python's Aura π₯
(It's not against their ToS, so it's technically legal to discuss here)
Is there a python edit
roblox insentiiveses people to program the game, they want you to use lua though
They made their own Lua fork, it's called Luau
I was gonna learn Luau actually, but never really was that interested in Roblox.
lua-u, unsigned lua lmao
like python? yes
lua is just long unsigned a
Lol
i use thinkpad...
Yea I didn't think Claude would be able to pull that off
I have a custom PC built by myself! :3
with updated everything
Lmao
yeah
What do you use it for?
Tried it first with no proxy and it worked
I was about to program in lua but it doesn't have built-in support for type annotations :/
wicked stuff

spam, basically
Annotations enjoyer?
mosty for fun
re-learning python rn, made this simple thingy: ```py
Write your code here :-)
print("how are you doing")
x = input(">")
print("great to hear that you are doing " + x)
print("what is your favorite number")
y = input(">")
print("oh so it is " + str(int(y)))
print("what is your name?")
b = input(">")
print("your name is " + str(len(b)) + " characters long")
a = 10 - float(y)
print(str(round(abs(a))))
if len(b) >= 5:
print("something")
elif len(b) <= 5:
print("hi")
elif len(b) == 5:
print("bye")
!code
thx
luau is luats++
you can actually run it outside of roblox
You can notice you've used the right one because it has syntax highlighting
print("like this one")```
how come mine didn't have synax highlighting
i changed it to 3 backticks
you didn't add the language hint
have to add py at the end of the first three
ohh ty
```py
Like this, with a newline for code.
Yessss
did they change the color theme or something?
yes
I think I'll js do 1 chapter per day' of automate the boring stuff w python
then I'll move onto other stuff for my meteorology thingy
Ofcourse
I was once a hater of it (sometimes i hate it but i know its a best practice now and is a standard)
peak UX change ||/s||
I'm forcing myself to use more type annotations, too, since it's a good practice 
+2
Did they actually increase the contrast of the theme? Or did I just get used to it?
Lmao
imo the highlighting is better but the colors are worse
Me with custom colors thanks to Vesktop

how are you doing
>Bad
great to hear that you are doing bad

mods, ban /j
HAHA
Ik, real
lua this shit
oh nvm embed fail
Malice? Smile?
gruvbox
Vesktop is just repackaged electron.
Ruby
Lmao π
That thing's OP song is still in my head.
Peak song
find a wallpaper you really like and base the theme on that
Should make one for Programmers
Yk what? I'll figure out stow and make a ruby rice just for you
That's cool
Aqua will like it fs
HAHA ofc
i just use pywal
i, too, use pywal
What's pywal
why are you using paywalls?
Pay to wall
a program that takes the major colors from an image and generates files based on templates
used to generate colorschemes for various apps from a wallpaper
Because they're indebted to walls
They're newspapers now
I wall for free
Lol
Ooohh, that sounds cool.
My system does that by default
-Wall -Werror for free
Noctalia shell picks up my wallpaper color and changes the .config of all the apps I select to match the color scheme
-Wall for free()
βΊοΈ
Holy gcc reference
i kinda want to get into ricing stuff myself at some point
but its a lot of effort
I am curious why it doesn't separate by whitespace than concatenation of value
ricing for looks bad
Does it supports -W {arg} ?
ricing for functionality good
well, i basically dont have a functional desktop
i only have a wallpaper and.. thats it
looksminning
this is the way
i have a linux rice with pywall
i would like the apps i use to be coherent
and like
actually have something
Omurice
can't have a cluttered desktop if you don't have a desktop
Try it, it's really fun. Just don't get into Waybar configs, that's the equivalent of hell.
gui is bloated use tty
i use pavucontrol for volume and it just gets out of the whole vibe
well
i can control volume with commands too so
same fr fr @gleaming knoll
How many cli programs supports -OptName{value} concatenated? Or just old ones and new ones don't do this?
WM?
Seems really cursed
I use it if I need the control, if just overall volume I have scroll bindings
im on hyprland but im not really attached to it
i just wanted to try it when first installing linux so thats what im on
a = 0
while a >= 0:
a = a + 1
print(str(a))
``` that goes hella fast wth
twin im also on hyprland
I don't wanna add support for it in mine but I don't want to lose wider range audience either
im on hyprland
Try noctalia shell. It makes ricing so easy.
It has plugins for everything lol.
Everyone is on Hyprland (I'm everyone)
i dont want to use a ready setup
super+shift+scroll iirc, it works well
hi everyone
i tried noctalia HyDE is peak
Noctalia is the equivalent of tuned waybar with plugin support
hi everyone, i am noone.
I used i3wm for so long that sway was the one sensible option when going to wayland
Noctalia is good for new ppl but thats kinda it.
i never used i3wm
I tried sway too :)
i have i3 on a 1gb 32bit laptop
its running void linux
I think GNU getopt does, which is ofc major
If it's good for new ppl, it'd be amazing for advanced people. I will learn QML to make my own plugins.
what does it even do
i have arch on a thinkpad 2gb ram openbox
Ooh, seems like i am gonna be incompatible with them
the laptop? its just
a thing
it exists
is this a cpu joke?
fair
I have Arch in my phone. Larping to the max.
use gentoo larp forever
i use arch
on a thinkpad
running hyprland
which i configure with neovim...
its like that really old grandpa in a nursing home
atleast he gets to talk with other peeps
fair
The true goat.
"I use arch btw"
3/4, passable
what's the fourth
What's the missing one
oh i also write rust
Or make the parser get cursed to handle such concatenated option-value
Why did they choose this, I don't find it any good
I want to learn Rust some day
hyprland no
Why not? Hyprland is pretty good, even if the creator is an idiot
i assume they mean sway
i actually dont use tiling
i think i would prefer scrolling
def _parse_long_option(token: OptionToken, context: ParseContext) -> OptionNode:
option = context.node.command.get_long_option(token.name)
if not option:
# have to implement that concatenated logic here. Or else:
raise UnknownLongOptionError(token.name)
hyprland bloat ngl
I'm too i3wm brained
same (first part)
Have you tried Niri? Pretty goated
so maybe i should jump to niri
i just use one-window workspaces
probably icewm am i right or am i right
me too
as long as you don't go floating/stacking
only i3 (maybe dwm but idk if they have the stack tiling from i3)
another thing macOS has traumatized me with
expected, cool
who tf uses stack on i3
except when i (code | watch videos) + browse something then its 2 windows on 1 workspace
I am back @raven urchin
macos worst os by faaaaaar
nah
My phone died
I mean. Tiling for laptop is kinda bad. Scrolling is goated for laptops.
I routinely have like 5-6 terminals on a workspace
s/macos/windows
what
is
bro
doing
Why
which terminal
i occasionally have 2
its terminal
i use zutty
inb4 alacritty
Alacritty anyone?
ghostty, since a bit
Kitty enjoyer herr
i feel like i should use alacritty
man,one day you guys will discover the beauty in st
kitty is a bunch of things i dont use
I got kitty on my arch server
same on main machine
use st trust me
same
And honestly when was the last time I did sudo pacman -Syu??
same, although I use my terminal emulator's tiling instead of WM-level tiling
multiple files, some long-running programs to monitor, some shells, some REPLs, it adds up
Holy months ago
*11
i did it the day before
Shit I didn't update my kernel...
that would be wise about now
Make sure to have Informant installed so it doesn't break when updated. It will make you read Arch news to see if you have to manually intervene before updating to avoid breaking stuff.
to get the patch against copyfail?
kitty has 3 problems:
1- 200mb per instance
2- features that doesnt really matter
3- slow
kitty is many things but slow is not one of them
Slow?
oh yea did yall get patched kernel
i probably have the slowest pc then
this
i patched it manually
didnt need to, arch already had 7.0.0 the day copyfail came out
Arch enthusiast?
I also use Debian and want to switch my main gaming laptop to it... But for now it is settled to Win11 because an year before I thought nvidia would suck on linux
i will never use debian for my personal computer
That's a great heads-up alright noted
debian is fine if you dont use the autoinstaller
mainly because i need my packages on the bleeding edge
debian is kinda ehhh, i use devuan on my larp laptop
Wdym lucky star konata in there bro
worst thing was trying out debian with gnome
Oh I surgically nuked gnome
worst de
Only libre office stands
peakiest office app everrr
Does it do the same for --long-optValue ?
man i hate how theres some good gnome/kde software,but because they are entitled to a de when you try to download it you get like 100 dependencies
nope
that would be kinda insane lol
Who who programs do -abcValue too? tar?
If I find any other gnome I will simply zao those out of existence.
My PC's fairy tale lands must exterminate gnomes
real
Lol
ok wait do yall use vscode, vscodium or raw code oss
Frfr true
argparse supports this
Neovim
cool
Left VSCode curse long ago
i use vscodium personally
they're mostly if you install more than one (as is likely)
also, the packages are split up (leading to more number of packages) exactly to avoid pulling in the entirety of their respective frameworks.
AmΓ©n
but mah package count
whats ur larp os
Depends On : at-spi2-core cairo dconf gdk-pixbuf2 glib2 glibc grilo gst-plugins-base gst-plugins-base-libs gst-plugins-good gstreamer gtk3 gvfs gvfs-mtp hicolor-icon-theme json-glib libgcc libgudev libmtp libnotify libpeas libsecret libsoup3 libx11 libxml2 media-player-info pango python python-gobject tdb totem-plparser```
Arch
I never tried that.
Is it dependent on Microsoft?
i have 1289 packages even though i have a barebones desktop
what the fuck is this
No, it's the one I used, is true FOSS
nope open source version of vscode
I am confused between Debian and Arch atp
Ooooo
hello
Hii
Wassup
my larp os is arch
hi
Recently gnome removed logout button
Mine too. I have 2 other OS and they do have a purpose. Arch is there for the love of the game
What is this for?
They're both goated
Nano is fine I heard it can be configured too
I used it for that too, but changed to neovim for everything
But usually using one editor is best
should i try neovim?
Of course.
True keyboard independence
It's pretty good, you can use it inside VS Codium too
Yes. Try lazyvim
what
ok i will
i use hyprland so i barely even use my mouse
Install LazyVim for Neovim, then on VS Codium install the Neovim plugin
That'll make Neovim the "backend" of you VS Codium
ok
That's what I liked about hyprland but honestly I think any wm comes with that experience.
I just tried awesomewm and it worked too
Is that how it works, or does it just enable vim keybinds for vscode?
now gnome is more minimalist wow next is reboot button
That's how it works. The vim one does emulate the keybinds tho.
With Neovim you can use the plugins inside Codium
yall