#python-discussion
1 messages · Page 347 of 1
😆
Hi
I vote that we get all servers emojis allowed again. idgaf about reactions. gimme my rust emojis back!
@dataclass(slots=True)
class ParseContext:
command: Command
namespace: Namespace
token_stream: TokenStream
end_of_options: bool = False
operand_index: int = 0
Okay so this class is used when we call parse_arguments() function, the function creates and uses this object and passes to other functions who need the context to work. It is mutated by both others functions and a while loop as we parse arguments.
I was wondering if I should use ParseContext or ParsingContext as a class name?

Are -ing in class names a recommended convention?
PC
Pythonic Computer
Program Counter
use imerative speac
sp ParseContext
what
imperative speech?
ermm.. trying to live translate 😄
parsecontext sounds like a function
yes, like Go West instead of Going West
@inland karma Are you the server manager?
what is a server manager?
i do manage servers in my basement and at work
good point, although using CapWords convention do helps defferentiating
but i would say im a programmer
okk
CamelCase
I thought that was camelcase
did i answer your question? not sure if i did
What's the difference between a programmer and a developer
oh sorry boss
He is a moderator and part of staff. He's not the only one, though.
snek_kes
oh reactions got enabled in this channel?
I don’t know what it stands for
Dynamic programming
a developer is a professional that makes, creates, manages software applications. the whole life cyclus. from planning, writing, maintaining, design and architecture
Why bringle?
a programmer just builds the software
I researched a bit, i think the course version is a bit better as im kind of a visual learner as well: https://www.udemy.com/course/automate/?couponCode=UD100FF
No I don’t know what that is
now, i am the fformer, i work as a devloper
but i see myself as a programmer, because that is what i find to be fun and interesting
your prefered learning style does not matter at all
That is a problem solving, which i also dk much about
Its similar to breaking problem down to sub solution which are optimal and storing thr result
it is more offten a hinderance to your learning
How does that help with backtracking?
Fibonacci is an example for DP
the best way to learn programming is to read, write and do the work yourself
style
well when i learnt html and css, i tried multiple courses and books , i did courses and practiced coding it worked
def commas(name_of_list):
customized_string = []
adding = 'and'
last_word = name_of_list[-1]
first_part = name_of_list[0:-2]
for i in first_part:
customized_string.append(i)
customized_string.append(adding)
customized_string.append(last_word)
return ','.join(customized_string[0:-1])
print(commas(['ajay','lodhi']))``` what is wrong here
yes sir
what's a bringle
So the programmer's deal is to implement given as per implementation detail/specification, and the developer does the task of making that specification?
not sure
Isn't this vegetable 🍆 called bringle in English?
sudoku problem is not solvable in polynomial time
eggplant
as long as you do the work yourself, you will be alright, but stay away from poor sources, like youtube and AI
its also aubergine
yes sir, got it
or aubergine I think EDIT: yes as the guy above said
the developer does everything,
oh
a junior developer is more a programmer and a developer in training
What am i doing right now?
are you doing software design and architecture?
@inland karma where have u been a developer btw if you dont mind me asking?, kind of interested
You mean company?
norwegian healthcare, orthopedic clinicque, accounting busniesses with integrations. Booking systems, large enterprise applications, data engineering and managing large scale platforms. .... ahh. company names..
well.. you have never heard about them
just insert company name here
Damn
unless your norwwwegian
So much experience
and a bunch more 😄
nah british
Im learning python recursion
crazy, probs a 20 yr experience
Nice idk recursion too
yeah, decades fly past me
respect
How much day i should put in learning or practice it
Probably years to become expert
In recursion
closest know thing comparatively is the NHS, Champion League and BBC
yeah learn about stacks and trees that may help you a bit
And also about recurrence relations
yh yh, i understand, respect though wide variety of sectors
recursion is tricky to learn, as it all happends in your head, its one off those things that you get after some effort
What's that lol. I am currently making cliargparser (i read argparse, google searched things, talked with AI about naming stuff and creating a philosophy for deterministic, zero-ambiguous parsing of cl arguments (since argparse is more of arguments focused than definitive parameters and introduces ambiguity sometimes))
So what am i?
i have thought recursion in 30 minutes, and they got it, and i have failed after days of trying
Please someone help me how should I learn python
Recursiion how much time I should put in
taught?
if you dont know, you are not a developer. you are a programmer! 😄
ignore spelling mistakes
I usually practice for days on similar topics like data structurea
There is no deterministic way
To estimate it
it's a completely different word tho...
Don't say until u understand it @velvet trout
how much python do you know already?
to have teached in the past tense
You do leetcode?
Did i say something wrong? 
Ok
"until recursion" is meaningless unless we know a specific course you have followed
@velvet trout no
I swear to god backtracking is so frustrating
Its dfs
dp is hard, do you know it?
You know dfs?
No
No course only self learning topic by topic@dry pike
No one helps
then "until recursion" is meaningless because the order of learning things is arbitrary
backtracking is just another variant of dynamic programming
I’m making a sudoku solver
you already have to know dp first
Yes i learn things in order
i know, but you still have to know dp
like what did you self learn using
How do I learn dp
it would be better to explain then
Chatgpt youtube Indian tutorial 10hr
Practicing each topic in depth
I know what it is
could u drop the link to the course, i bet lots of people here probs know it
then you should learn it
Search on yt CWH python course
Recursion is basically a function calling itself right?
anyone know that one?
Yes
Or is it something else
How much time i should learn it
well, you have to do some work while your doing it, thats the DP part
There are some other things to consider like base case. Or else it would keep calling for ever
Yeah Ik
Yesss
So learn dp before backtracking basically?
yeah, once you really know dp, the explaination off backtracking makes the implementation self evident
@inland karma
yeah
basically these all are problem solving strategies
Recursion itself follows another strategy called divide and conquer
Am not that expert at algos
def commas(name_of_list):
customized_string = []
adding = 'and'
last_word = name_of_list[-1]
first_part = name_of_list[0:-2]
for i in range(len(name_of_list) - 1):
customized_string.append(name_of_list[i])
customized_string.append(adding)
customized_string.append(last_word)
return ','.join(customized_string)
print(commas(['ajay','lodhi']))```
i used debugger to do this...but still one error is there
You start with divide and conquer then greedy like dfs then dp then backtracking
try this: def commas(name_of_list):
if len(name_of_list) == 1:
return name_of_list[0]
return ', '.join(name_of_list[:-1]) + ' and ' + name_of_list[-1]
print(commas(['ajay','lodhi']))
@quartz fulcrum
what is the error?
ajay,and,lodhi prints this
Name exposed
i dont want two commas
why do you have two commas?
this line is issue wizard: return ','.join(customized_string)
idk
then you must figure out that
and u never used this: first_part = name_of_list[0:-2]
how do you add commas?
oh, it is because of join
yes
yes, its because you add the commas everywhere
what should i do then
copy my version and see if that works
only add commas where you need them
def commas(name_of_list):
if len(name_of_list) == 1:
return name_of_list[0]
return ', '.join(name_of_list[:-1]) + ' and ' + name_of_list[-1]
print(commas(['ajay','lodhi']))
Hey @grave wedge!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
that is easy
i shld ve thought about it
When is Len even useful?
but didnt click
It seems so useless but I see it so much
when you want to check the length of something
no problem
I know, but when does that actually come up
suppose you have a bunch of users
when you want to know the length of something
when else?
show him practical side
and then you use len to find out how many requests you received
does that make sense?
print(f'Your password is {len(password)} long')
@pseudo coyote
Guys what project should i know basics but my function knowledge is kinda cooked
make a calculator where each operator is its own function
Len is like showing how many letters in input?
Yh
hello world😆
yes for a string, that is what length means
Ok
I did that
And this one
What about int?
thats beautiful python lol
an int has no length, its just a number
Okay
make a bank entrance program which uses a wide variety of variables
what would be the length of an int?
I think its kinda complex
len(454000) what should this output
give it a try
Try
then its pretty usless
454000
i mean what do you think
i didn't ask u
?? u try it if u want
oh my bad
why would u think that?
Well you asked a question and we gave an answer
didn't ask u
Its an integer
did you try it?
This is general
Im on my phone rn
well, integers have no length, length does not make sense
so you think len() would just print it?
@iron sable maybe a Grocery Store Bill Calculator
because, in what base is the integer
Or i dont understand the question cause my first language is russian
How cool would it be if i override the built-in data type's __len__ dunder from CPython source code and install it on all my college computers 
wow you can put that in your resume
Or it will print 6
integers are immutable, you cant change them. you can make your own CustomInt
why is that?
Cause of the…idk how to explain like its starts counting how many numbers are there s
Yeah i know int type does not impls dunder len method, but what about list, tuple, dict and such types to change their dunder len to show random lengths
programming is not a guessing game
just say you dont know if you dont know the answer
randomized search algorithm enters
it's ok to not know something
no i mean, the source is immutable, you cant monkey patch the object
if it is written like '89000', then len work otherwise you cant put len on numbers\
none of the builtins let you do that
I think i know but idk how to say it in English
so you would have to change the C source, build python again, and then you can
K
well, once you are on your pc, try running len(5) and see what happens
What if i edit that in cpython source code and then reinstall python, like you know the code hosted on github in objects/ directory
Sure
whys the server profile looks like a clown
yes and for that the object must be an iterable you must need a starting point and an ending point
the number 45000 starts at 1 2 3 4.... 45000 so why would its len be 6? and its pretty obvious that its 45000 so why not just let it be?
what if i just made another function called len()
just fork the repo and change the language, you are free to do so
That is overriding?
Wonder if it will even install or initialize the interpreter if i do that lol
in python, behaviour is connected to functionality. len is the function, __len__ govern the behaviour
Yah, but i was thinking about doing evil things changing dunder len to give random number and install it on all college computers
🥰
it happened to me twice.
i feel like i forget everything about git and github second time
Why
you can change the name off a function, you cant change the behaviour if the source is immutable. you can however make your own object and implemnt your own __len__
Alr
use git every day, and you will learn it over time
Yeah you mean i make a class and copy the len dunder code from string class
Or inherit string and override
Because they made me learn stuff which is Offtopic to my core stream subjects + teaching 8085 assembly microprocess (i am not interested tbh, i wanna learn something like C (low) or python (high)) + made me write code on white paper instead on an IDE + their education/teaching methods sucks, its rote learning/marks based.
So taking my revenge 
but from where do i start..
i have a udemy course on it. it is lengthy and learning from it will be too boring
Aahh
Also included one of the regional/commonly spoken human language in IT/CS streams. I was like, what— why should i care about language over computer languages.
fun fact: this won't work
when you write a small amount of code, commit it, when you add another small amountl commit that
and continue to do that
😢
Lol 😂
are you from punjab?
"fun" — that ruined my fun 😔
we also did have stuff like physics chemistry mechanics engineering drawing electrical electronics civil mechanical basics all for our 1st year
But not languages
Like regional ones
What stream?
CS
heyy anyone learning backend framework??
Ye
Wanna know? This was a newly implemented Education policy. Imagine being this dumb that you kill stream subjects by adding additional off topic and unrelated fluff.
imma continue making evil plans using my little programming language 
do it..if your heart is clean...you will regret it
I was heartful all the time.
I understood the hard way:
Peace was never an option.
Fight for your right
US universities will have three sets of courses you need; university wide general education, college specific core clssses, and then major specific requirements. Gened often includes things like writing& languages
What is your question, do you have any?
like i am starting to learn flask so i want a roadmap to proceed
Start with the flask tutorial, they have a nice one
are you 7 years old?
18
be kind
oh fine
dont look for roadmaps, they are mostly all terrible
the tutorial meantioned above is a great place to start
ok there own docs??
Flask docs seem good.
But if you want a insight of how backend dev works you can check https://roadmap.sh/backend
But don't try to learn everything they list
Choose what tech you like
i just guessed hig age from the name
I see. I just want to learn CS purely, no extra Subjects i have done lots of subjects for last 12 years (Indian system). Now i just want to focus, not get distracted, especially for students like me who are bad at learning things than average students. 🥀
Yah, I hear you. This is a common complaint about University curricula. I felt the same. I think Englands system is cleaner; last three years are major only, afaik
On my way to transfer to england 
I think now a days especially in web dev people are first choosing tech then making projects with the tech
In old days first problem might be solved and tech were used as tools
To solve the problem
i am part of modern day dev
Yes and no, picking a new stack is hard and risky. There's safety in sticking with well known patterns
My companies have been burned by decisions. My last company went through 4 web frameworks in 10 years
i feel like authentik is overkill for my use case @inland karma
its an overkill for me aswell... but it wasnice to test out
heh
i just wanted a mock server
why not arduino
its sensible to have a small computer if you need one
oh right okay
Can it run a web server and like 4-5 websites
Who
duck
That looks like a ball shaped
It is rather spherical
Looks like a fish
Ball fish
Puffer fish
Fisher puff
What's up guys
This is a collection of documents published by the BBC R&D Cloudfit team delving into the detail of technologies we have found interesting or useful during the course of our work.
python docs andrealpython is also good
Wait BBC news channel also teach Python? 
In my country this is expensive as shit
Btw guys why does python use snake case
pretty easy to read
underscores look like proper spaces
🤔
python still uses PascalCase for classes and unseparated lowercase for many stdlib modules though
Pascal and camel case look good
stdlib has a mix of weirdness for historical reasons.
I don't like the look of Pascal or camel case
i like how PascalCase distinguishes classes from functions and normal instances
Agreed, its a nice distinction
C++ also has snake case in its std lib, hard to read
Because it is python
this_reads_better_to_me vs ThisReadsBetterToMe
Ye, that's good
🐍
Ye maybe sometimes snake case looks good
"sometimes"? 
Snake case looks good only on long names
I imagine there is a sliding scale when divulging AI usage is required/appropriate
Having snake case in python gives you just an opportunity, you don't lose anything.
like, for full on vibe coding it's obvious, for "I used one copilot completion" less so
ehats the occasion for the new banner? looks sick
so? I am not sure which to pick. Both sounds good
See #changelog
cheers, that’s nice
or when there was something AI generated that was inspected and mostly all rewritten in the process
code of Theseus
Hello
I am trying to write a program which takes a linkendin address and returns everything in the js page. But the bot detection keeps stopping my code. How can I bypass it?
Isnt there a free api for linkedin?
which?
searcch it up 🙃
I only came across playwright, which is paid.
um do u know whats api
I was writing a function and the IDE autocompleted a default return, made me jump, I don't use any AI in my IDE. It was a good line though so I kept it. Probably from a legacy copilot install.
something that acts as a communicator between two programs?
ah. sorry mb, Its proxycurl. not playwright.
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
Bypassing the anti-botting measures of Linkedin would definitely violate their ToS
I didn't know that. But it can be done using proxycurl api. how so?
It's not about whether it can be done or not, it's about us having a rule to not assist with projects that are inappropriate, malicious, illegal or violating the ToS of other services.
I. e., we can't give you any information about that type of project.
As a side note, it seems like Proxycurl was shut down in 2025 following a lawsuit. From Linkedin, for not following their ToS.
That last bit is hysterical in context.
Isn't it?
I got it as a work project. What am I supposed to do now. 😐
(a) ask your boss, (b) ask linkedin how to use their api
other than that you're crossing over into asking for help with something we can't help you with,
Hi all , I have been working on extensive doj parser and research pipeline in nativelab for parsing Epstein case files and segregate them as per timing event sequence missing sequence and hypothesis generation , for this currently m choosing , multi context pdf chunk reasoning with back context support , based on continuation keywords and event consolidation , any other technique for retrieval of large files without loading all in context with maximum back context would be helpful. Also needed help on image identification models for low quality images , if any .
Linkedin has official API services, but the kind of data you want is probably not gonna be available for free, especially not to another business. Maybe look into what those options are and explain them to your boss.
is that socratis on ur pfp?
If they literally want you to steal data through scraping, then sorry, your employer is pretty shady and we just can't help with that.
No, it's Epicurus.
Epicure? they made a statue of the CEO of the seasonings and dips company?
Yeah, thanks for the info. I informed my supervisor. Will look into paid apis. Also, just a curious question, is web crawling illegal everywhere or just linkedin?
It's not typically illegal anywhere, but the vast majority of major services forbid it in their ToS
Depends on bot.txt
Bot.txt?
Some types of automated crawling can be permitted, like search engine and AI indexers, but it depends on the service what they allow
robots.txt is the filename used for implementing the Robots Exclusion Protocol, a standard used by websites to indicate to visiting web crawlers and other web robots which portions of the website they are allowed to visit.
The standard, developed in 1994, relies on voluntary compliance. Malicious bots can use the file as a directory of which pag...
Yeah each site manages a bot,txt for bots to state terms of crawling and limitations or to deny crawling before scraping any site you must make sure your model complies with bot.txt
Yeah robots.txt
But even if they permit stuff like that, they virtually never permit you to just scrape a bunch of raw data off of them for free
I'm using a simple one:
User-agent: *
Disallow: /*
Allow: /
But I also have more rules against bots implemented as cloudflare rules.
Ah, I was told to store everything on the domain to a json file. Including the redirects, image names etc. Which thanks to you now I know is illegal.
I did some research rss feeds are mostly allowed and msn has pretty lease for bots
to a json file?
nevermind the legality
Well, not illegal. It's not a crime. But it can lead to getting banned as well as civil lawsuits.
the format is questionable
Format conversion can be done later after scraping anyway
who stores things on a website to a json
His use case might be different ,who knows ?
yea but that doesnt stop me from questioning their engineering decision
Anyways , i don't think that question makes sense for data storing , it maybe his convenience and other framework dependencies
I mean, if I'm just experimenting with a new feature, I might just dump data in whatever way
True
You don't gotta architect everything upfront
surely you would just dump the files into a directory
Yeah, maybe? Maybe a json file?
Not really my place to question in what format they need as an output. Besides, why is it so wrong? I always get my outputs in json format.
if it works , it works
a website consists of multiple files, some of which would be image files, which are binary files, which is weird to store in json
Cmon , why would someone store binary in json he would just store img path in json that's it
Oh. Well, I wasnt told to get the images par se. Just the names?
Also json is one of most easily supported library for python and other frameworks
json is not a library...
You could store text data and metadata in json, and paths to any binary blob files.
yea, makes more sense
eh whatever it's against TOS
import json
A there a python tutorial here
is it possible to get python syntax in VScode WITHOUT access to internet?
Yeah
Download extention
please refer to the ladder half of the message
Hmm i don't get it
i can use a USB pendrive, but not administrator perms
Ohk , download extension file from GitHub install using file
hi
json is a format, python's standard library merely provides a convenient way to parse and serialize objects to that format
Cmon,
k. so git clone https://github.com/microsoft/vscode-python.git in the USB? What would need to be done after that?
Yeah ik
Download .vsix
& where is that?
Is namedtuple recommended for a tuple of size 2 and you do not want to remember indexes (although easy to remember but still) ?
I do not want to create a full-fledged class for this short thing. 
i think i am beginning to find good use cases of using namedtuple?

code --install-extension ms-python.python.vsix
Replace with ur filename
what is the bitwise operator
uhhh arm64?
things like shifting bits etc
How will I know that 😭
Operators that operate on bits from one or two integers
@tribal drum I think their point is that you can't download things if you have no internet.
Nah he's downloading from another device and transferring via usb
K guys if anywant wants help dm me, m going off now
this
There must be a tutorial somewhere on installing Visual Studio Code extensions from a file
What's the difference between a namedtuple and a dataclass?
Btw vsix works on any platform until u have vscode
one is a tuple with names, the other is a shortcut for making classes
You asking to know my knowledge or wants to learn the knowledge from me? 
@inland karma i just realized that i mixed up bearer token and access token, which are 2 separate things
EDIT: nevermind, apparently bearer is a type of access token
It is just like normal tuple but you access it through name (attributes) instead of subscription protocol / indexing [int].
That's how i understand them
I know the essence of dataclasses but I couldn't provide a formal proper explanation.
I think they allow accessing via index like normally, just that they also allow accessing via attributes
I want to learn the knowledge from you, cause I just checked the docs for named tuple just now and I was not sure how they differ in practice
Oh so both, nice.
I am pretty new too, to namedtuple
Same I don't use them
One thing to keep in mind: namedtuples, are tuples, so the values are immuatable
So are dataclasses, no?
hey. Who is interested in game dev but game dev feels to complex / hard so you dont learn it??
no, dataclasses are just shortcuts for classes. you can make them immutable but they are not by default
Im thinking of making a game engine for my next project
Dataclasses are classes with useful default implementations for things
Well, i only find the need to use namedtuple is when i want less overhead of a custom class and a dataclass, where you just want a container to be able to unpack, index and access by name (namedtuple also provides a good repr like dataclasses), it will make sense if you first begin a tuple and eventually realize automatically that it could become a good namedtuple too.
That's based on my experience. No idea if there's a detailed list or recommend good practices about when to use them vs when not.
Ah okay, so a namedtuple is basically a frozen dataclasses.dataclass?
In terms of usage, obviously not under the hood
It's just a slightly advanced tuple, and i like that about it
??
I view dataclasses as rather concise'nification of custom classes with a good repr, init & comparison methods. They're for simple states or facts. Go with a full fledged when you find yourself conflicting with dataclass or doing almost everything a dataclass already does.
there's also simplenamespace.
import json
from types import SimpleNamespace
x = {'data': {'type': 'msg_logs',
'content': [{'msg': 'We be nesting data'}, {'msg': "lot's of data"}]}}
logs = json.loads(json.dumps(x), object_hook=lambda d: SimpleNamespace(**d))
print([x.msg for x in logs.data.content])
# ['We be nesting data', "lot's of data"]
Yup! That's another niche & cool thing
That's why I got into programming in the first place
so about this shift key...
Personally i ahve faced a lot of issues with multiplayer in godot. I just feel like its easier to do certain parts in threejs but setting up camera, llighting all that in threejs is hell. So i was thinking maybe my own game engine for creating web / mobile / desktop games with javascript as scripting language
It sounds like you are trying to do too much at once.
If you are struggling with camera and lighting, don't do a multiplayer game.
Its not too much. Babylonjs exists
Do simpler games to start with and work your way up.
No.. I am kinda pretty good in godot
So you don't need to learn everything at once.
Just that lighting and camera setup is hard in threejs compared to godot due to lack of ui for game editor
and godot's multiplayer is hell.
I mean its easier than unity / unreal but its really hard compared to syncing things easily by js
I was thinking maybe a game engine Ui on top of babylon with ui similar to godot and js as scripting lang
It feels like a common pattern for aspiring gamedevs to spend all their time developing game engines instead of games.
I mean its going to benefit a lot of game devs...right??
If you finish it and it turns out to be popular. Which is a very long shot.
I dont know if its going to benefit a lot of ppl tho. thats why im asking before starting the projet
ot0
Mispaste
basically dont trust microslop
fact.
anyways, should i try doing this project? I was thinking normal js scripting + unreal's bp system / scratch based block coding For no code game dev.
It's your choice.
I'd rather make an actual game myself, even if I have to make compromises with my tooling sometimes.
For perspective I've been writing my own 3D FPS game in Python, and it's challenging, but I appreciate how dirty I'm getting my hands
i mean i dont really have any projects to do 🤣
I mean if it helps a lot of ppl if done correctly why not give a try
If you see an instance of something you want to try yourself, absolutely give it a shot, and by all means stand on the shoulders of giants
stand on the shoulders of gAInts?
New hotkey discovered!
In PyCharm, place your key on a line
Hit command + up-arrow, it'll move the whole line up one!
no
vv useful. works in most common editors
i jest, but people here would genuinely do that
Sadly, yes
It's useful when it is being applied in a highly narrow, specific, refined way, and the vast majority of how we currently use it does not fit these criteria
It's being sold as the Everything Machine, when it should be the This One Very Specific And Narrowly Defined Thing Machine
I take this stance: AI can only ever reflect for own expertise back at you. For now anyway. It can't do anything you can't do, and you've got to be wary of it's pitfalls
the thneed
But if used by an expert in a field, it can make a huge difference in both the amount of legwork you have to do, and the quality of your work
That title didn't fit in a browser tab so we had to shorten it
yea it just so happens that the things that I do are not mainstream enough yet for LLMs to be able to handle them
RIP
i use arch btw
💀
It's a light novel title, you see
it's almost as if experts in the field are doing things that LLMs cant
/jk im not an expert
_>
@inland karma thanks for attempting a solution to the programming problem after i left. alas, I did try it (read it all sadly) and it wasn't quite what I was looking for. I am up for the help channel thing alas, I must confess, I don't know how it works on discord.
In a year, I've given myself a solid understanding of ML. It took a lot of work and there's still a long way to go. But I could never have gotten this far without ChatGPT to work through it with me
I don't know about never but it's good you were able to get constructive use out of it.
And this project I'm working on? A programming language - an executable graph based ontology of the MtG universe, with bytecode interpreter and other bells and whistles? Again, AI has been invaluable
oh yeah you're that guy
I prefer to think of the AI not as a separate thing, but as myself as a cyborg. As with any skill, I have to take care to maintain best practice. I can't just throw a problem at an LLM and expect a solution
But I'm so, so tired of people complaining about AI, it being evil, it being useless
If it isn't helping you, you're using it wrong
Its not that prescriptive
Many of us are equally tired of being told we're "using it wrong". So you use your LLMs and I won't. We can co-exist that way.
no worries, its easy to get sidetracks into overlapping details! 😄
true, details matter when you want to make things work
im still confused btw
Most of the complaints about it being evil and useless and so on are not unfounded, for the same reason that complaints about coal mining being dirty and environmentally devastating are not unfounded (even though you can make an argument its energy was how we kickstarted the industrial revolution). People are not happy about these things for good reasons, and we're only going to get good things out of them by being skeptical, not hagiographic
still reading docs
many confusions are connected to understanding what things really are, and HTTP is the same way. HTTP is just sharing text with each other
some text has meaning, like 400 and GET
but another thing that has meaning is Bearer
go on?
so wwhen you use GET you know that this is a http verb for getting data
All of that is fair. For as much use I get out of AI, it's a many faceted phenomenon. Some parts are great. Others, horrifying. If nothing else, it's civilization-changing. All (well, most) of the well reasoned critisism of AI, I agree with
when you use Bearer you already know that the next piece of data is a auth token
mhmm
and all the tools we use are just abstraction on top of just sharing text messages back and forth
authentication has a predetermied methods for how many times text is shared back and forth, and what those text messages must contain
A general question: if you are writing a Python package, and you have elements in it that are not themselves Python files (text or image resources), what's a best practice way to handle those things as part of the package?
But its getting really old for me listening to people - not really smart coders like on here - but people who genuinely have no idea what they're talking about complaining about the technology that I use every day. And more than that, complaining about the people who the technology
there doesnt seem to be a good resource with some standardized examples of what message gets sent to which endpoint and what the endpoint responds with
and we connect words on top of this to explain more in detail, but HTTP is simple in nature. and AUTH is simple as well, it has multiple simple steps
OAuth2 is a spec, and if you use that you must follow the spec
WAIT https://docs.python.org/3/library/importlib.resources.html I think I found something relevant.
yea, the spec is like 20 pages long
which i mean... sure
but like
it's 20 pages
and the part you use, maybe JWT, is only a few pages
As someone who's been a solo dev my entire life, having something that can respond immediately whenever I want has been enormously appreciated
Its given me multiple "why don't you just..." suggestions that have halved some of my scripts
But I spent Tuesday trying to get it to write a feature and it fell of the rails practically immediately, it got stuck in a loop with itself because I renamed a bunch of stuff and it couldn't decide whether to ask me to use the new names or the old names
It takes skill to "prompt engineer" and get the context explicit enough for the AI to be able to "stay focused"
And the time it takes to do that is commonly longer than the time it would have taken for me to just spit out the code myself
i dont remember, been ages since i read it
the point im making, is, its simple, the abstraction on top might make it harder to use or understand
The build backend you use can assist with this as well. Hatch, for example, automagically includes all files withing the ./src tree. setup-tools has knobs to configure for what non .py files to include within the ./src tree.
Outside of the ./src tree is where I fall over with knowledge.
Hello
Out of curiosity, which model do you use?
well at least i have something "interesting" to figure out
Open AI's latest when using the .com
Opus 4.6 when going through Copilot
so when you are working with authentication, details matter. and when you know which part you are using, follow the rules lied out in the spec, and/or your auth library/provider docs
Fuck yeah. I know it's a rich ecosystem, but like a simp I just went for the most familar name when I started using AI, and ChatGPT has never done me wrong
if you have curl installed, you can do everything from the terminal
Not really, anyway
no fancy python auth lib needed
in this case i am the provider
which is the problem
before this ive only used oauth to authenticate
and you have to follow the spec the client expect. thats the OAuth2 spec (if your using oauth2)
not implement it myself
I'll have to experiment. I want to build some facilities into pydeploy that allow you to bundle non-Python resources with a Python package elegantly with your deployable. Right now you list directories to copy over that are placed just off the root of the deployed artifact directory, but I'm open to better solutions wherever they may be.
yea i am both the client and the auth
the client side, thats authlib
this one is trivial
!pypi authlib
I hate that thing
hmm usually i use the provider's own api client
Do they support SQLA 2.0 yet?
like e.g. i use the gcp api client instead of authlib to connect to google drive
They're all doing the same Oauth2 handshake. Just different baked in parameters.
Yeah half the time I just end up doing it manually
Roll your own OAuth2 handshake once. It's interesting how simple the flow actually is. Demystifies is.
roll your own oauth provider meanwhile...
If you want, just don't use it in prod.
Still not terrible
yes, important to demystify things
it's just for experimentation mostly
thats why i think every engeneer should raw dog their own http server
what dog? 🐕🦺
Which is the best reason.
rust book!
lol, after the political fiasco with the US goverment, recursive_error convinced me to try Claude Code so I just canceled my Gippity sub and subbed to Claude instead
I get Gemini included with my other Google subscriptions too
So time to try something new and spice it up a bit
It's impressive how much clarity it can bring.
oh yes. same with anything that is protocol based
i made a mc server by hand. also demystified a lot
the "understanding what it really is" is actually not that problematic
it's the standardized implementation
I love the pure programmer energy in this statement
that is the difficult part
@robust ledge have you done your own OAuth provider?
I did it myself after getting angry at how terrible Authlib was
It only supports Client Credentials at the moment, but thats all I need to implement myself, interactive auth will go through Microsoft's massive SSO ecosystem
this might just be for experimentation, but i still want to make it realistic from the client side
And you know, that's a great suggestion. I... struggle... with servers. Building one from scratch would probably be a good exercise
||which one?||
isnt authlib a client library
yes
its both
Provider, no. Client, yes.
i did this with SAML2 a few years ago. provider and client....
wait what
The thing I'm tired of are people on both sides being irrationally for or against it. There are both real benefits and real risks/harms, and it's when people turn a blind eye to or overinflate either one that it's frustrating to me.
i was reading this page https://docs.authlib.org/en/latest/oauth/2/intro.html and i lol-ed at the drawing
Nuance and whimsy are starving for use in the Internet. 
instructions unclear, ingested rustonomicon
yessss
src/manageorders_sdk/client.py lines 27 to 40
def _update_token(self: Self) -> None:
"""Update the OAUTH token."""
if self.token_expires_at > datetime.now(tz=UTC):
return
auth_dict = {
"username": self.username,
"password": self.password,
}
response = httpx.post(f"{self.base_url}/v1/manageorders/signin", json=auth_dict)
response.raise_for_status()
data = response.json()
self.token = data["id_token"]
self.token_expires_at = datetime.now(tz=UTC) + timedelta(hours=1)```
Ignore the id_token
These dumbasses got AWS Cognito to do everything for them and still couldn't read the instructions
lol
But yeah, with OAUTH, its "just" a POST /token (for machine auth)
omg authlib already has an example: https://github.com/authlib/example-oauth2-server
how did i not see this
read all the words
dont skip anything
😄
i prefer reading the code...
then the author failed
you gain knowledge from docs, if the docs is made correct
ok yknow the docs is pretty good
learning, understanding, goals and information
This. This is why I'm so raw
compared to what ive read for the past day
Its such a big issue, and I'm so tired of people claiming to have a solid answer to it
here, if the docs have this, its a good doc
which are OPs trying to sell their ready made
i am surprised how a small code can do very productive things
whats this
that is a good measurement of quality
many lines of code is not a good measurement
an overview over what good documentation looks like
ok the authlib's docs is actually very good
i find it well made
though it might also be that i have been gathering and synthesizing loads of resources from all over the place so now it's like a revision/summary
i seldom like to read docs that are made by companies with a product to sell
like really old already-merged ones?
or like from the most recent comment?
merged ones yes. but not reversed in that way, newest to oldest
yes
understanding of a codebase is something you get from reading PRs, last changed to least. it gives you an idea of what just broke, what just had to change and what the current syle is
though, probably not a hobby everyone should have
what? reading PRs?
reading a codebase trough PRs... its often not important to know a random codebase
ofc, a codebase you work on, super important, but thats not a hobby, thats work
I agree
I've done that before when I want to understand some open-source project
im reading tinygrad right now
Authlib provides a ready to use AuthorizationServer which has built-in tools to handle requests and responses:
there we go
that's where the good docs end
i smell clanker content
it's not
this is authlib's docs
i mean i guess this was what i really wanted?
but now im too deep into trying to understand how it works
behind the scenes
im investing time into getting my AI model to actually work this time
because if pewdipie can make his own ai model, then for sure i should be able to! 😄
though, i actually think he is a genius under all the joke-fasade
(I saw his stuff before he got large)
i have only seen his python developer journey
"i was doing it before it's cool"
(/jk)
I remember his early amnesia days
i was his viewer when logan paul became popular
I haven't followed him for many many years, I recall he's a university dropout who turned full time video game streamer. Granted it's been a while since then
oh god, it's been 15 years?
snek family 🐍
Click https://boot.dev/?promo=PEWDIEPIE and use my code PEWDIEPIE to get 25% off your first payment for boot.dev!
Thanks Boot.Dev for sponsoring this video!
🌏 Get exclusive NordVPN deal here ➵ https://NordVPN.com/pewdiepie It’s risk free with Nord’s 30 day money-back guarantee!✌
Sankyu:
DeepSeek - https://www.deepseek.com/en...
I know he made that video recently, yeah
Hello
Is it possible to make my own api which scraps the web(specifically linkedin) for data?
he spent his early years shouting at chairs and barrels
Ooh, love the new icon, what’s it for?
Holi!
Thanks I always lose it 🙏
linkedin does not allow you to scrape their data. i think they have an API you can buy access to though. but have not looked into that much lately
apparently it was like 2 weeks ago
following your question from just now, do you know what is an "API"
Im sorry @grave tree if i was abrasive yesterday, it was not my intent to come of like that. Ill try to be better in the future! 😄
ah yeah, I don't our branding calendar was updated for the 2026 dates for the holidays that shift
Thought so. Told the same thing to my supervisor. And this was his reply
"Whats the use if we cant make our own and have to depend on external API
RATHER USing then figure out how they are doung and try to make one" 🙄
no really, do you know what an API is?
Mostly only the definition? It's a program which is used for communication between two softwares?
yes, in this case, you are trying to access some data from linkedin right?
linkedin and other large sites, like amazon spend a lot of resources by dynamically change their frontend code so you cant scrape it. and they also enforce login so you have to accept their terms and not only relly on robots.txt, and their terms say you are not allowed to scrape their site.
the "accessing data" is being done by a program that linkedin writes, that's why it has access to the data
i know how to bypass it but ima gatekeep :/ (mainly cloudflare anti bot and other anti bot things)
it's like asking if other people can write a program to access your company's database @quick compass
(an api is not a program, but rather how programs interact)
I'd tweak this, and say it's a collection of functions inside a program purpose built to query and answer queries from another program
(a programmable interface that applications can use)
!pypi linkedin-api-client
But, I'm no expert. I think it's in an important distinction, whether an API is a program which wraps around another program, or, a set of protocols inside a program
an interface for applications that is programmable?
only thing that matters is that it is an interffface you can program
Atleast from the above reply you know they dont want to use paid apis.
how fcked am i?
if you want to let other people interact with your company's database in a limited way, you can write a program that does the "accessing data" part, and then let other people call this program through an API.
hence, it's a logical contradiction to suggest that you can write an API to access linkedin's data yourself
one could say that
my favorite api is pathlib
is that an "is" or a "has a" relation?
it's quite logical to write an API that provides methods to scrape LinkedIn


creating an API doesn't necessarily imply direct access to the database
you could have (and indeed there are many) APIs which wrap a scraper
Question, why is scraping not permitted? It's not like I am accessing restricted data, just what's on their page.
...
they don't want you to
Because you are now accessing just their data and not their advertising or the other things on their platform. They don't like that
Guys, you must see this before working
LinkedIn's Terms of Service (ToS) strictly prohibit the use of bots, crawlers, scrapers, and other automated methods to access, search, or scrape data from the platform. Automated activity that violates these terms often leads to account restrictions, "LinkedIn jail," or permanent bans. [1, 2, 3, 4]
Key Aspects of LinkedIn’s Robot/Automation Policy:
• Prohibited Activities: The User Agreement explicitly forbids using any software or scripts to scrape data, copy profiles, or send mass messages/connection requests.
• Detection Measures: LinkedIn uses sophisticated AI to detect non-human behavior, including rapid profile viewing, unnaturally consistent timing between actions, and unusual IP addresses.
• Penalties: Violating these policies can result in temporary or permanent bans. In some cases, users are required to submit government-issued ID to restore access.
• Permitted Activity: Only authorized API integrations or manual browsing are generally allowed. [1, 2, 3, 5, 6, 7]
Permitted Automated Crawling & IndexingLinkedIn has specific, separate terms for authorized crawling (e.g., for search engines):
• Express Permission Required: Automated crawling without prior written permission is strictly prohibited.
• Respect Robots.txt: Approved bots must abide by robot exclusion headers.
• Usage Constraints: Data collected must be used only for search indexing in public search engines. [8]
Risks and Enforcement
• Account Restrictions: Using browser extensions or automation software to mimic human activity often triggers warnings, such as "You've reached the weekly invitation limit" or "We've noticed unusual activity".
• Data Privacy: Automated scraping is often considered a violation of both LinkedIn's user agreement and privacy legislation.
• Lawsuits: LinkedIn has taken legal action against entities that scrape data, treating such actions as a direct threat to their business model. [1, 3, 6, 10, 11]
]
it is very resource intensive, and they want to keep their data on their own platform in most cases. its all policy of use, not law. we do repect any sites terms of service
the whole point why they are asking for an API is because they are told it's against TOS to scrape the frontend
Automated activity that violates these terms often leads to account restrictions, "LinkedIn jail," or permanent bans
lmfao, I love that they have a name for it "LinkedIn jail"
im not saying it's technically impossible
this is what i summed up earlier, but yes. your not allowed to scrape linkedin
im saying it's impossible according to the TOS
you said it was a logical contradiction
can i ask you, what's the point of this API?
I mean, does the supervisor think that if you scrape you aren't dependent on them somehow? If anything you are more dependent.
Anyways half of linked in is ai generated , better you can use deepseek ai
truth
I think we can take it down a notch, y'all are just talking slightly past each other.
zehata is answering the question of "can you build an API without violating LinkedIn's ToS?". Other folks are looking at the question without the ToS restriction
I guess he doesn't know what he is talking about. Ill have to talk to someone else and make him understand.
Btw hi Bharadwaj. 👋
why would you build a frontend scraper, provide an API for that scraper and then go and use this API to get the information from the page. that's just the same as building a frontend scraper without the API part
hi 👋
And it will be blocked eventually 🤣
^ this is the logical contradiction i was trying to say, i apologise if i phrased it wrongly earlier
So bottom point is, there is no "allowed" way apart from using paid api, is there guys?
Anyways if you wanna scrape linked in the illeagel way is use chromium chrome driver then use beautiful soup , and np.random to generate request intervals this way you can skip detection
yh you are right.
doesnt work anymore
but we can use not allowed way.
Ohh ,
Done that. Didn't work.
chrome driver gets caught easily
we shouldn't discuss that here anyway
Second option you have is use mediapipe and on screen ocr
for all intents and purposes, consider it impossible
hmm, you can use another way
there are very many method
But all are illeagel
Eh, its okay. I dont want to do something stupid and get my ip banned.
Every advice given here by me was for " educational purposes only."
you will not get you ip banned.
you can use proxies
that doesnt work in a court of law, just so you know
but it's ok
pls y'all, our rules 😩
It works , aldr faced it once
In ipo
ok
happy holi python??
unauthorized scraping discussion in my python discussion chat? 
must be a day that ends with -day
Saint Patrick day
Nah I was giving education on mediapipe and chromium usage
pi day when

the real pydis .topic list:
- is AI going to take over software engineering in a <some duration of time>, <some famous person> said so
- how do I scrape <some website with TOS disallowing scraping>
- python is so slow, <some other programming language> is better
- what youtube channel should i watch to learn programming
- ive been making <some impossible software>, i have met a small bug, can someone DM me, im willing to pay
- *sends
.topiccommand* ".topic list is so boring, we need to update it"
Python was genuinly slow not only cuz of language but cuz of abstraction layer using a custom linux with stripped off unnecessary features and binary penalty helps a lot
don't forget "I'm looking for partners in my business/project"
'Any Python professionals in here that can mentor/coach me'
please use pink logo server its better
Not free currently buddy but can help you with errors if any
Who cares about the logo
I'm just glad the mojo topic has died a swift death, that was such an annoying period of time
me
The what?
is mojo replacing python?
🍿
unironically an LLM based .topic command would be nice ...it should pull the recent N discussion in #python-discussion and then return a new topic ...prolly a good case for LLM
when mojo was first "released"/advertised, I swear every 5th message was about it replacing python
it'll come back next february :-)
Wth is Mojo 😂
Typically when the topic command is used, it means that we need a new topic different from the previous discussion
Python is for ml , now making a calculator in it and comparing to c and java is like , rest we understand 🙂
I've never heard of Mojo in my entire life
yeah exactly, so the LLM could make sure the topic is always different based on the context
i read a lot of blog posts/podcasts on it
as mentioned, the topic died a swift death.
M using multiple llm to complete the Epstein files and reconstruction of their doj
im sure that would be totally accurate
it's a custom lang meant to "speed up" python ai dev workflows
Anyways , if you compile a python app with nuitka , speed improves ,
But yeah for large apps and library time is 📈

I don't really get why people hype programming languages so much in the first place. Kinda comes across as LARP most of the time
but hey, at least it did what it promised: it was faster than python...
...at dying
it is used, though
by who? mojo?
mojo is not OS?
I have never seen a programming language which is not open source
wait maybe apple script
C++?
What part of C++ is not open source?
apparently zilog isnt
now what is that
mainframe programming language
or am i mistaken
i was indeed mistaken
it's some microprocessor
Didn't Microsoft close C# and then people forked it?
do someone know how can i verify me ?
wym by that
you need read #voice-verification properly
do you mean voice verification?
Certain (popular) compilers can be not open source like MSVC
Isn't large portions of Java / JDK still closed source?
But things like clang are open source right? The spec certainly isn't closed source
any language could have proprietary implementations, in theory
Clang is open source ye
a more salient point would be that the official ISO C++ standard is behind a paywall
* working drafts are public, but the actual final standard costs a couple hundred USD to access
Someone can make a closed source Python implementation, I don't know if that would make Python closed source though
oh what
Yeah, but you can't really say a language is closed or open anyway I guess. It's mostly about the compiler
I think you can in terms of spec though, right?
What do you mean?
^ see
A language, at its core, is a specification. It is describing behavior or how to use the programming language and how the programming language responds and is structured. It's why sometimes we have to draw a clear distinction between a programming language as defined by the spec vs implementation behavior
You'll often have a reference or default implementation, but that's still based on the spec
my language only has one compiler, there is no spec, would you consider this closed-source?
If you wanted someone else to use your language, you wouldn't provide them any sort of docs or instructions for how it behaves?
i do have docs but they are FAR from being a spec
I don't think I really understand what you're saying. Are you talking about documentation for a language or the syntax itself?
how am I meant to escape the bytestring so the exec will run?
exec('z=[[v," "][2<sum(z[x-61+y:][:1]<"$"<v<"/"for y in b'\x08\t\n<>pqr')```
Coding roulette 🔥
well no, since you put it on github...
SyntaxError: unexpected character after line continuation character
In the strictest of sense, can I take your compiler, modify it and redistribute it according to the four freedom?
That said, there is far more to the sustainability of an open source project:
- Does it depend on a single committer?
- Are changes welcome and made inclusive and without friction?
Some might talk about open community for instance
Create a global variable , use backslash there escape byte string
It's also why the Apache Software Foundation has the motto Community over code
it's not possible without making it global?
It is depends on python version then
the project pretty much relies on me and i dont accept anyone elses opinions
unless you fork it ofcourse
This issue mostly was solved in python 3.12
I'm using 3.14
anyone here know discord.py?
yeah, that would not make it non-OSS.
These questions come after, once it becomes popular
Hmm i don't know much then but global variable may do it or even a local variable
Look at C++ or Python, the language is large and its expected behavior is documented in the docs, right? The docs describe the syntax and the behavior
id like to not have to make it a variable
Ah, well I see that as part of a programming language.
If you have a 'programming language' without providing documentation it wouldn't be any different from writing random English words :)
Kinda like saying I fixed an impossible math question without showing the proof or a verified result
With a backslash before the quote in b' and its closing quote?
you could argue the source code is the spec
I think you're still not fully understanding me. Mojo has basic usage instructions, but it does not describe the language's expected behavior, right? I'd compare it to Python's documentation, especially of its token parsing, etc
i changed the quotes and now I'm getting this error
File "<stdin>", line 3, in <module>
File "<string>", line 1
z=[[v," "][2<sum(z[x-61+y:][:1]<"$"<v<"/"for y in b
^
SyntaxError: unterminated string literal (detected at line 1)
exit status 1```
the issue is the ' after the b is closing the exec string, no?
Which is why you escape it
Shouldn't you use r strings in such cases?
you need to double-backslash there
ah yes
'my b\'byte string\''
it works now
exec('z=[[v," "][2<sum(z[x-61+y:][:1]<"$"<v<"/"for y in b"\\x08\\t\\n<>pqr")]for x,v in enumerate(z)];'*650)```
Very pythonic code btw
soo dontasktoask . com is blocked in this server. Why so?

Because it's often dropped in a rude manner and creates a non-friendly atmosphere
it's friendlier to tell them directly to not ask to ask, instead of dropping a link
it's code golfing
Instead, just say hello.
different kind of priority
I know 0.0 about Mojo so no clue if it describes the expected behaviour or not
just say "please ask your question directly" or something of that form
I see, okay didn't knew it was rude
yeah I think I'll just go back to my last method cause this is longer
I see
im reading this documentation on oauth: https://connect2id.com/learn/oauth-2#example-auth-code-flow-step-1
it says:
state: Optional opaque value set by the client to maintain state between request and callback.
what does opaque mean here? that this value is not relevant to the auth process?
I forgot , is oauth by Google?
from where do i learn git and github?
opaque means you're not supposed to rely on or modify the actual contents of this value. you get it from somewhere and you pass it on as-is.
(substitute you = whoever it is opaque for)
Quite a lot of guides on the internet / Youtube
oauth is a standard that is used by multiple companies including google
so, it's not related to the process yea
it's just a way for the client to store some info to get back on the callback
git init
git add .
git diff
git status
git commit -m "abcd"
https://en.wikipedia.org/wiki/OAuth
Seems a group of folks got together from different companies, made a spec, and many companies have since adopted it
@pallid garden Personally I use firebase for authentication. its dead simple. Just suggesting
Thanks
Thanks
this is an academic exploration
Alright
if the cluster has an internal oauth implementation, the public facing API should provide the relevant routes as well, right?
it doesnt actually do anything, the data just gets passed through
to the client, the public facing API is the oauth interface, and the fact that the oauth service is running on another node is just an implementation detail, right?
def keyword actually goes in the same order as in alphabets.
A, B, C, [D, E, F], G, ...

Another reason why python is easy, if you know alphabets ^
Wdym
collections.abc then def. Now we just need something in the stdlib called ghi
A B C [D E F] G ... X Y Z
python's function defining keyword def has letters in the same order as they appear in English alphabets A to Z.
Wait i read that wrong lol
is pyautogui worth using
And then jkl, mno, pqr, stu, vwx, yz!
one letter less
Everything in python is worth using
Because of such a beautiful language it is.
A beautiful conclusion. Delving even further, G-H-I just kludgily live, making not one Pythonista's quintessential repertoire
raise EnglishError("gotta use translator")
git diff seems a bit useless here. You already staged everything, so the diff will be empty.
Oh, but finishing this easter egg would be cool ngl
git diff --cached works
So will git diff --staged
maybe the spam and ham can be fried in ghi

