[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 750kdcr9qxla1.png (1.09 MB, 2557x1436)
1.09 MB
1.09 MB PNG
Python chads, what's your favorite library?
>>
>>100158919
The one I made myself to complement the complete shitshow of our payment provider's API. It's actually useable now, I've received many thanks from colleagues
>>
>>100158919
Python sucks-ass as long as you aren't using it to program anything you should be fine.
>>
>>100159065
Here's your (you)
>>
>>100159065
Retard.
>>
>>100159132
>Retard
How so? I'm right, python is only for writting scripts not programming you should be using libraries since writting anything in python means it will be slow.
>>
>>100158919
Ahh, the joys of dynamic typing.
To answer your question though, pytorch is all it's good for
>>
>>100158919
json

press x to json

i like traversing json without having to put a trillion braces and brackets everywhere
>>
>>100159162
>writting scripts not programming
>>
>>100159262
Scripting is not real programming.
>>
>>100159162
>>100159339
The fuck, do you program with butterflies or
something?
>>
Python is shit but Rust is 100x worse and isn't even safe.
The perfect trifecta is C, Lua, and Bash. You literally do not need anything else.
>>
New York Public
>>
>>100158919
my job is Excel spreadsheets out the ass, so pandas
>>
>>100159702
>i hecking love typing braces and brackets and dollar signs and then and end constantly everywhere
>>
>>100158919
>Rust
Why not declare them as
>unsigned char
while regular char is signed?
>>
>>100159970
>I love having my code not compile because I didn't use right amount of whitespace characters.
>>
>>100160078
>using notepad.exe to write python
>>
>>100158919
is even
>>
>>100158919
The standard one.
>>
File: file.png (29 KB, 747x189)
29 KB
29 KB PNG
>>100160027
because rust has a type autism that requires explicit cast for practically everything
>>
>>100160132
cnile go back to your containment thread. Python doesn't have a clusterfuck standard lib like c++ does. Thank god for that.
>>
>>100158919
yt-dlp, buku and openpyxl
>>
>>100158919
I program mainly in C/++ due to working on embedded enviromnent but I respect Python simplicity.
I just finished writing a program in it that parses multiple files looking for specific keywords to compare them to another file and then creates a new file with the keywords in common between the initial multiple files and the last one. I spent maybe 2 hours total doing it and it works just fine. It's kind of refreshing coming from C/++ and not have to worry about value types, headers, pointers, strings etc.
>>
>>100160162
>Python doesn't have a standard lib
https://docs.python.org/3/library/index.html
>>
>>100160208
>posts the built in functions and data structures
I don't understand what you are trying to get at by posting this, you don't consider primitive types part of the standard library for C++ do you? Don't tell me you are that retarded.
>>
File: 1545603168541.jpg (246 KB, 728x728)
246 KB
246 KB JPG
>>100160078
50 IQ retard detected
>>
>>100159339
You are a complete moron if you think that's a meaningful distinction. You probably think that there's such a thing as "compiled languages" and "interpreted languages" too.
>>
>>100159702
>Lua, and Bash
Why do Python haters always the most poorly designed and unmaintainable dogshit languages? Were they born worthless retards or is it /g/ brain rot?
>>
>>100160378
python is bad because it's popular. lua and bash are good because they're less popular.
>>
>>100160394
Because they're terrible to actually program in. Sometimes things go well and popularity aligns with good design.
>>
>>100158919
"What's this argument? What does this return?"
>kys

Thanks Python
>>
>>100160498
If your that retarded, then document your code or use better variable names retard. Its really not that hard to understand what is happening in a function by just looking at it.
>>
>>100160444
i actually program in python and js for a living. js is clunky asf but python is good for what it's designed for: scripts, glue code and iobound tasks.
>>
>>100158919
Having few implicit types is good when you're writing scripts, which is what Python is good for, but well defined types save a lot of headaches in large programs
>>
>>100158919
>figure out how (fundamental feature) works
yes?
>>
I can't even install a library without getting 500 pip error messages
>>
>>100160590
skill issue
>>
>>100158919
Obviously pandas
>>
>>100160539
>your that retarded
And yet you're* the one throwing stones...
>>
>>100158919
i used to hate it but after a whole year of being forced to use it i now think its practical and comfy to program with
but its only useful for simple programs or tools that wont be used too often because its so fucking slow
>>
Opencv
>>
>>100160078
(You) just reminded me that IndentationError or whatever exists. I think I last saw it 4 years ago
>>
File: lmao.jpg (11 KB, 229x220)
11 KB
11 KB JPG
>>100160078
The absolute state of /g/oy
>>
>>100160394
>bash
>less popular than python
lol
lmao even
>>
>>100158919
i just started learning python. it's better than html.
>>
>>100161645
I don't get the joke
>>
>>100158919
The one that doesnt use C for all the heavy lifting, whoops all scripting languages are leeches.
>>
>>100160498
Use a type checker in large projects.
>>
>>100159970
>t.typelet
>>
>>100160253
holy shit you're a retard
>>
>>100158919
OpenCV, NumPy, pandas and Matplotlib are what I use the most.
>>
Lots of baby ducks ITT
>>
>>100160253
Are you retarded?
The library reference includes a brief review of built-in data types and the rest is entirely libraries, everything from compression and basic csv parsing to OS-specific interfaces like msvcrt and posix.
>>
>>100162137
My first language was BASIC in 1985. Posters on /g/ who use the term baby duck are wrong nearly 100% of the time.
>>
>>100160556
>iobound tasks
Exactly. You wouldn't write heavy algorithmic stuff in it, but it's perfect if you have a fairly simple IO-bound task of a few hundred to a few thousand lines, like a GUI for tagging images or a web scraper that saves to SQL.
>>
>>100161693
Why is this supposed to be a bad thing? You use the right tool for the job: C for the heavy lifting, something high-level and garbage-collected for the glue. Python has other big political problems, but I don't think that your criticism is a sensible one.
>>
>>100160156
aren't you niggers complaining about lmao javascript implicit type coercion so goofy
wtf do u want then?
>>
>>100162285
Take that fedora off your head it looks retarded. Scripting languages should stay in their lane.
>>
>>100160556
I hate js. Python is alright. C# > Java. C is fine. C++ the necessary evil, but you can ignore certain parts of it. Rust is gay for trying to a be a better C++ and making it retarded. I'm not an amazing programmer and C is hard. C++ is a complicated mess and it's annoying. My first exposure to programming was Python, but i dropped it quickly before picking it back up. I used Java in my CS classes. Java sucks, but i'm most comfortable with it. I like C# because it's similar, but better. I like gaming, and i liked C++ when i first started learning it. C is cool, but hard. I would prefer to stick with C# and Python, and keep getting better at C++. Lua pairs well with C++, but i'm not familiar with it. I don't really care for any other languages. Oh and i fucking hate web development. I much prefer software development.
>>
>>100162304
Never seen anyone complain about u16 -> u32 promotion
>>
>>100162427
>i hate js
>python is alright

retard
>>
>>100160078
Just stop using Notepad++ Rakesh.
>>
>>100159702
>>The perfect trifecta is C, Lua, and Bash. You literally do not need anything else.

Nah, the perfect trifecta is C++, Go and Python
>>
File: 1713982626714.png (465 KB, 600x938)
465 KB
465 KB PNG
>>100162427
Based normie
>>
>>100158919
There's a reason Python has come to dominate the world of programming and it's not because it's good. It's because every other language is somehow worse.
> C
Garbage std library. Bends the knee to retards stuck on a standards 40+ years old who refuse to update which keeps the language shackled to the needs of a bunch of boomers. A massive shame because despite this it's still one of the best language we have.
>C++/C#/Java
All are bloated messes with years of legacy cruft that should of been in libraries instead of in the base language. C# is somehow the only one taking a step in the right direction by slowly obsoleting all the retarded choices of the past.
>Rust
Quickly becoming a bloated mess. Ran by a committee of retards.
>Go
Utter horseshit. if err != nil fucking everywhere. No objects/classes but instead has a bunch of retarded bullshit to try and imitate them. Every go code base of a decent size is an utter fucking mess. Quite quick though so it has that.

Python might be a slow mess that forbids any sane human to use a for loop but at least they have the right idea of a minimal base language that is easily extensible and stips out all the needless boilerplate, has one canonical way of doing something that the language is designed for and there is minimal tard wrangling you need to do to around the language. It's slow and its package manager is dogshit but it's the only language that is somewhat sensible in 2024.
>>
>>100162427
I hate webdev too. I've been during Python 2 years then went Java. I'm almost at 5 years since I switched to Java and I want to fucking switch to non webdev shit. Constant bikeshedding and solving stupid simple problems with overcomplicated complex unreliable systems is constant whenever I go. I don't know how anyone can stand this shit. I die inside more and more and it doesn't get better ever. When I talk before I join a project people praise the project like it's a second come of Jesus and every one of them is worse than the one I've been before. It wasn't that bad at "worse jobs". It looks to me that where they pay is better the projects are worse in every aspect. It's like the people killed they brains and just can't see the thing for what it is - Inefficient, bloated, buggy, retarded SHIT.
>>
>>100158919
I seriously loathe any dynamically typed language. I've been putting off learning Lua for neovim configuration/plugin development just because of how painful it can get to read code. Like you're almost always guaranteed to get vague limited set of data structures as well
>>
>>100158919
>Traits are hard
Yes, Python users are retarded, we knew this.
>>
>>100158919
Turtle graphics
>>
>>100162895
How do you feel about Lua and Elixir?
>>
>>100159162
>Python is only good for my very limited use case anyone using it for something else is wrong
Python is super useful and great for programming. Honestly what's nice about it is getting something out quickly. A lot of programming languages have all this boiler plate around actually getting something done. While python you just write what you want to happen and it happens. Sure its not the fastest, but that is a worthwhile trade a lot of the time.
>>100159702
>Lua
>arrays start at 1
Into the trash it goes.
>>
>>100163413
>this
typescript and python are retardily more enjoyable outside of web, once you are only doing a couple things with outside libraries they are a joy to use.
>>
>>100159162
>writting (sic) anything in python means it will be slow
$500 Costco PCs have CPUs with 8 cores running at 5 GHz. I think you'll be fine.
>>
>>100162895
>C
They refuse to update because a lot of these companies need their build systems to stay compatible with legacy systems. C has to stay simple in order to keep the embedded space. The reason no language has replaced it is because it has always kept its eye on whats it intended purpose.
>go
Go is a great language.
>but err != nil
That is way better than error handling on most languages. The try catch paradigm is ugly and a pain to rigorously catch errors. Go keeps it simple, by allowing you to reduce error handling to one question. Did an error occur?
>but you can mimic this with just a general error class in a try catch block
Sure, but then you deal with the bloat of exceptions which are expensive. Go treats exceptions like a returned value meaning you don't have to pay the cost of an exception. Also you handle exceptions as they happen instead of defining a scope and then being forced to narrow down to a specific exception. The whole flow is a lot nicer and makes predicting exceptions a hell of a lot easier. I would argue one of the greatest mistakes of C++ was introducing exceptions the way they did and it probably caused more bugs than null did.
>>
>>100163636
>8 cores
Erm, someone should tell him about GIL
>>
>>100163699
>someone should tell you that GIL got removed
https://peps.python.org/pep-0703/
>>
>>100163732
>Created: 09-Jan-2023
Wake me up once it's done
>>
>>100163755
Gil has been removed you just need to use a setting to get rid of it.
>>
math
>>
>>100158919
>he doesnt know about hidden linkage
NGMI
>>
>>100162427
>hate js. Python is alright
>C# > Java
>I like C#, because it's similar, but better.
all of them fucking suck OOP dick.
>>
>>100163595
Many other languages have that too. The issue with Python is simply that it has many design decisions which have absolutely no justifiable reason to them.
I don't like 1-based Array indexing but it's at least an actual tradeof, there is literally no reason for python's:
>Loop variables assign rather than create a new scope
>Every value can be used in a conditional and random arbitrary values test as false. If you want to be able to use every value then at least make only False and None test as false.
>functions that reach the end of their body without returning return None
>default values in function arguments are executed at function definition time, not when the function is called
>initialization and assignment of variables shares the same syntax

These things aren't tradeofs. They're simply bad behavior that makes it easy for bugs to happen that only exist because Guido never gave it any thought, or because CPython was simply implemented that way resulting in this behavior. I seriously doubt Guido ever sat down and thought:
>Yes, default values should be executed at function definition time so every single function call shares the same list in the arg=[]. This is a very good idea opposed to giving each of them a new freshly allocated list, just think of how effectively programmers can use this!

No, of course not, there's no reason for this to ever happen and it's the store of bugs when programmers forget that if you somehow modify that list in any way, the next call to the same function gets the modified version.

And then Python3 came along and he had a chance to fix many of those issues and he didn't. He instead focused on making print a function rather than a statement which is such a goddamn trivial thing compared to these problems.
>>
>>100163595
>>Lua
>>arrays start at 1

Was about to say this. Not a serious programming language
>>
>>100160590
That's because your version of python is either not up to date (or more likely too much up to date)
>>
>>100164042
Opposed to:
>0 tests as false in conditionals?
Is there ever a case you want to use that opposed to being more explicit and using x != 0.

It simply leads to bugs and if it not lead to bugs the code gets unnecessary verbose because someone did have to check for it and now has to use
x != None
everywhere anyway to account for that x may be 0.
>>
File: 1695086778189356.png (434 KB, 760x521)
434 KB
434 KB PNG
>>100163778
you have to compile python with a flag, it's not like a box you check.
>functions that reach the end of their body without returning return None
"Explicit is better than implicit" kek
>default values in function arguments are executed at function definition time, not when the function is called
The standard advice is to not use mutable arguments, but that's a cope to get around bad design
>>
>>100164005
>x = 10
>some_string = "Hello"
How is this a problem? Every dynamic language is pretty much the same.
>>
>>100164005
>Loop variables assign rather than create a new scope
That is a trade off its just an annoying one. If you don't create a new scope then you are able to improve speeds because you don't have to drop elements created in that scope. If it was C you could just set the stack back, but because you have objects that requires a garbage collection to occur.
>Every value can be used in a conditional
That is inherited behavior from C
>random values eval to false
I mean just explicitly test for None or what you are actually testing for. I don't like it, but it can make sense if what you are using is empty.
>if a function doesn't return anything then it returns None
What would you have it return? Don't assign things to functions that have a void return. How is that a python only problem.
>default values
This is annoying as fuck and I have no argument against it.
>>100164124
>not out of the box
Its still an option.
>>
>>100162325
>no argument
>some mention of fedoras out of nowhere
As expected from a worthless moron like you.
>>
>>100162427
>I hate js. Python is alright.
Yeah, this. This board is full of morons who hate anything popular. Python is actually pretty well designed, unlike JS and Lua.
>>
Rust xisters what is our response?!
>>
>>100162895
Opinion on Kotlin?

>>100163477
>vague limited set of data structures as well
Elaborate?
>>
>>100159065
the only people who shit on python are larpers who dont actually get anything done
>>
>>100164005
Yeah, agreed on many of these (though not on None, I think that's a good decision, and you're uninformed on the changes in Python 3). Python has several flaws, I just think that Lua's defect attractors are vastly worse in practice.
>>
>>100158919
my favorite more niche library is probably statsmodels
>>
>>100162895
/thread
(although idk if the go take is accurate since Ive never used it, although I want to use it just havent had the excuse to yet)
>>
>>100162895
OCaml?
>>
>>100164376
Kot -lin
>>
>>100162207
And yet none of that is needed to create a good data structure like a functional list unlike in C++. You've lost this, cnile.
>>
My only problem with Python is that Matlabs default plots look beautiful while matplotlib looks like a 6 year old drew it with a huge crayon.

Sure, you can fiddle with it and make it better but why can't it be decent at default like Matlab.
>>
>>100164633
just use seaborn
>>
>>100164633
Tried plotnine and hvPlot?
>>
>>100158919
lmao that is exactly how one of the rust youtuber looks like
>>
>>100164161
No? Javascript has always used “var x =...” for initialization and “x = ...” for assignment. Originally the latter would also initialize in the global scope but that was later considered to be such a mistake and leading to bugs that it was disabled in strict mode. And Python could learn something from strict mode rather than he Python3 fiasco in how Javascript fixed it's issues incrementally rather than relying on people rewriting entire codebases, it allowed old and new code to mix more easily.

Lisps don't do it either, and neither does Lua; it has nothing to do with dynamic typing.

How it's a problem? It's a problem that if you make a type in a variable name when assigning it simply creates a new variable and silently undiscovered rather than immediately errorring that you were trying to assign to a nonexistent variable. Surely you can see how that can lead to many hard to trace bugs and even to social engineering attacks. Just pullreq with code that assigns to a variable that looks identical but has a weird unicode character in it that looks the same in order to bypass a security check and boom.

There's no value in it and no reason not to demand say
var x = 10
for initialization. What? Having to type “var” is too much? It makes the code far easier to read too because the programmer can instantly see what a new variable is and what assigning to an old one is.
>>
>>100164317
>That is a trade off its just an annoying one. If you don't create a new scope then you are able to improve speeds because you don't have to drop elements created in that scope. If it was C you could just set the stack back, but because you have objects that requires a garbage collection to occur.
No, they're dropped when they get reassigned anyway. Python's gc is reference counting and the reference is decremented on a new assignment, scope or not, the same number of drops occur.

>That is inherited behavior from C
And it was stupid there. There's a reason almost any modern language demands a bool.

>I mean just explicitly test for None or what you are actually testing for. I don't like it, but it can make sense if what you are using is empty.
Yes, just make sure bugs don't happen.

The issue is that it's easy to overlook at times and bugs do happen. The point is to make it as hard as possible to create a bug due to oversight.

>What would you have it return? Don't assign things to functions that have a void return. How is that a python only problem.
It would throw an exception obviously to try to use the return value from a function that reached the end without returning.

And yes it's a Python only problem. It's a an error, either static or dynamic, to try to use the return value of a function that doesn't return. There's no universe where this is a good idea.

The point is that the situation of:
>A return value was used from a function that reached end of execution without returning
Is almost always indicative of a bug, something the programmer overlooked.
If a programmer intend to return None, he can simply use
return None
and be explicit. It's almost never the desired behavior.
>>
>>100159162
You have never worked a day in your life.
>>
>>100159189
How's `clicked` defined?
>>
>>100159970
I would rather deal with a bit of boilerplate code whilst knowing my code works well than the massive 5k lines of python "code" with dynamic runtime errors
>>
>>100160539
yes, but then you assume that this function is written well and that "x" actually is what it says it is. Python is shit to debug if its written by some pajeets that you have to then understand what they fucking wrote
>>
>>100158919
>Traits
>Hard
>>
>>100162779
Notepad++ is what's used on laptops at my job and white space errors are a common reason for faulty router configs. What program should I request to avoid this?
>>
>>100165657
Any well known ide would do. Whether it's vscode or any of the jetbrains stuff. But if it's just a config file you could just write a script to verify the config integrity before saving to version control. You do version control your configs, right?
>>
File: 1691535901299476.jpg (1.53 MB, 3024x4032)
1.53 MB
1.53 MB JPG
Python fans have the lowest standards ever.
>>jupyter notebook
Ever used wolfram language?
>>matplotlib and numpy
Even matlab is better
>>I have so many libraries
Yea made by pajeets, API design feels like you are coding C
I'd rather use JavaScript
>>So many one liners
I can minify my non white space languages also to one line
>>elegant
def fun(opt=[]):
opt.append(1)
print(opt)
def __dumb_shit_names_you_need_to_know__():
>>Forced tabs are good because uhh they are!
Use an autoformatter, oh right can't do that with Python!

At least hello world is a one line, right guys?
>>
>>100158919
Have you heard of the data types in NumPy?
>>
>>100164161
It's a problem when you do a typo

long_descriptive_name = 2
long_desxriptive_name = 3
>>
My favourite library is mne. If you know, you know.

>>100164427
Not that niche. It's quite big in science land.
>>
Python sucks donkey dong
I use it everyday at work and I hate it
I rather use rust but you know
no jobs
>>
>>100165796
Yea. Why don't you use a programming language that is actually designed for such tasks so that you don't need to care about that shit.
>>
>>100159189
Readability, not even once
>>
>>100165817
That's a skill issue.
>>
>>100165834
>Open-source Python package for exploring, visualizing, and analyzing human neurophysiological data: MEG, EEG, sEEG, ECoG, NIRS, and more.
oh boy i can't wait to get falsely diagnosed with brain cancer because my hospital used freetard hobbyist software
>>
>>100165728
I'm just a lowly site tech slowly learning configs. I was just cable monkey before this job. Most of the configs we create so far we use a generator provided by the telcom we're contracted to. We are getting more freedom as those tools are show to be broken but I'm still new enough I haven't really been given a lot of opportunity to dig around yet. What the would the script to verify integrity look like? What would it be checking for or comparing against? I've only just started learning python via the mooc course.

I don't think the company saves configs beyond backing up the running config on the router before changes.
>>
Reminder every programmer with any worth uses python for everything besides web shitters, they aren't even human. My whole infrastructure runs on python scripts and lambdas. Our whole backend runs on python. And guess what? 0 issues, and everything is easy to do :)
>>
>>100158919
Numpy, matplotlib
>oh let me guess, you need more?
>>
>>100165834
well, more niche than pandas an numpy that is
>>
>>100165122
You make some good points, but the None thing makes no sense to me. A value literally called None is the most obvious thing to use when you request the value from a function that didn't return anything. In a statically typed language you can just make sure that nobody tries to use the return value of a void function, but what Python does seems to be the best solution for a dynamic language.
>>
>>100166130
Numpy is great, it forces you to learn property because every time you google "how to <thing> in python" the SO result is always some fucking retard telling you to use it.
>>
>>100160078
kek the same shit happens with bash, especially when you use shit like awk
>>
>>100159065
spbp
>>
>>100165760
one line which runs in 0.5 seconds and takes 10MB of RAM
>>
ITT broke losers

It's cool that you know brainfuck and can helloworld in C, but what's cooler is having a salary
>>
>>100164377
this
>>
>>100165122
>truthy and falsely values bad
It was nice to be honest. Although C did it the smart way and only did it on null or zero meaning you never bad the issue of dual meanings to a false. Its a good way to check if something exists. In Python I'll give you it is less useful, but it can still be nice in some cases.
>overlook
Then just set a rule that you have to explicitly test what you are testing for and to not lean on truthy variables.
>halt the program on void assignment
I think you are making this a bigger issue then it is. I never really enjoyed the rust nanny compiler and don't really want to see it everywhere. I think it is reasonable to expect that the programmer should be expected to handle that without some weird check that would slow the implementation down even more than it already is.
>>
>>100158919

pybind11
>>
>>100163413
90% of backend niggerdom can and should be replaced with proper SQL triggers, stored procedures, queries, database structure, etc. For example https://postgrest.org/
>>
>>100166140
Or you can throw an exception?
It is the most logical value to return of any value. But it's not logical to return anything if the programmer didn't put a return statement anywhere.

It's almost always an error and I would argue that this behavior shouldn't ever even be used when wanting to return None and explicitly returning it is always better.

Dynamically typed languages can throw errors at runtime you know. There's nothing wrong with throwing an error for this, or for using anything other than a boolean in a conditionl.

>>100166450
No, it's an unclear way to check for that.

Even in C, it would be better to use
if (ptr != NULL)
, especially for variables that don't have an obvious name that imply they're pointers. It makes code clearer and helps catch errors.
>I think you are making this a bigger issue then it is. I never really enjoyed the rust nanny compiler and don't really want to see it everywhere. I think it is reasonable to expect that the programmer should be expected to handle that without some weird check that would slow the implementation down even more than it already is.

Throwing this exception is no more expensive than deciding to return None. It checks in either case and decides accordingly.

I've never seen Python code in the wild that actually relies on this behavior. If a function reach end of execution without a return statement and it's value be used, it's almost always a bug.
>>
>>100166729
>don't have obvious names
Its obvious what the type is by how you use it. If you are checking if a ptr exist you are probably going to use it soon.
>Throwing this exception
Sure, but halting can be an annoying issue especially if you are checking for None anyway. The entire point of a dynamic language is to have more flexibility in the language and the checks. Turning around and saying that this is now a bad thing is silly. You are complaining that every language isn't either rust or go. Especially considering that the languages that are most popular tend to be the ones with less checks not more. I mean look at JS, ruby, python etc.
>>
>>100166729
>explicitly returning it is always better.
Yeah, that's what I do. It's clearer. But I don't mind the default None return at all. It has never caused me a problem in all my years of writing Python.
Some of your other points are well taken though, if there was a distinction between creating a variable and assigning it then maybe we could get rid of the inelegant global/nonlocal statements.
>>
This is false you still have to cast int to other numerical types in python
>>
>>100158919
>>
File: GigaChad-1-3964134466.jpg (26 KB, 400x400)
26 KB
26 KB JPG
>>100158919
>>
>>100158919
python-dateutil is based. Has saved me a lot of time not writing my own parsers for timestamp strings pulled from different sources.
>>
>>100162854
Based
>>
>>100162854
The perfect trifecta is Holy C
Can't wait for there to be a working CLI HolyC on unix
>>
>>100167120
just use lambda functions with datetime and you dont need dateutil at all
>>
>>100165330
Stop letting pajeets write your code. There I solved your problem.
>>
does anyone know how time.monotonic() works?
>>
>>100166061
Before any editor stuff convince your team to version control what you write.
Just use git. There are other options but just go with git for now. It's plenty popular so if you run into something you don't understand you'll be able to find help readily. (Note that git=/=GitHub, so you don't need to upload anything to a third party service if you aren't allowed to by your company).

As for the script, it would depend on the specification of the config file. For example if the syntax was json and had a specific json scheme you'd validate the config against the schema. If it's a whitespace sensitive syntax you'd maybe want to warn or strip leading whitespace in certain areas. I couldn't tell you exactly what to do without knowing what type of config file you have. Since you mention there's some sort of generator the telecom company gives you, they should have a scheme for the config file as well. If possible ask them for that schema and then use it to validate the config.
>>
>>100158919
pywidevine :)
>>
>>100166161
Same thing with pandas :(

I mean I love it... But it just should not be used for half the things people do. The worst offender is using it read in data from a spreadsheet or database only to just use it to find a particular row. It would be way more performant to either use the standard library csv module or the ouput from the database adapter which is typically some sort of iterable. Constructing the Dataframe itself requires you to iterate over the whole data at least once. Just loop over the data directly.
>>
File: 1685842344788688.png (7 KB, 138x196)
7 KB
7 KB PNG
>>100159656
fixed it
>>
>>100162236
>tfw first lang is QBASIC in 2004
>>
>>100166729
>Throwing this exception is no more expensive than deciding to return None.
Raising and handling an exception is always more costly performance wise than a conditional.

Regardless, If you didn't have implicit None return and instead raised an exception you'd always have to explicitly write return None even for functions where you don't need to use the return value. The only other alternative would be to handle the no return exception every time, which would be absolute awful design. I'd argue that's way more confusing.

Anyone purposefully using an implicit None return value is probably a junior and needs to be told to cut that shit out.
>>
>>100158919
kys library saar.
>>
>>100158919
>if you want to do this you need to try to figure out <basic feature of the language>
How terrible. Have they no consideration for low IQ individuals that barely managed to learn C or python? Reminding them they wasted all the brain plasticity they had on beginner shit, it makes them feel bad
>>
>>100160027
Because "char" stands for "character" and rust is not ancient boomerware legacy software, so it actually is a character, meaning a unicode codepoint. Characters are not signed. Nor unsigned.
>>
>>100168678
>Raising and handling an exception is always more costly performance wise than a conditional.
You don't catch it obviously. It's an error when it occurs. It's like trying to catch the error of adding a string to a number, it simply shouldn't happen. And that too would be a disaster if it returned None instead or throwing an exception.
>
Regardless, If you didn't have implicit None return and instead raised an exception you'd always have to explicitly write return None even for functions where you don't need to use the return value
No, the exception is only thrown if the return value be used.

>Anyone purposefully using an implicit None return value is probably a junior and needs to be told to cut that shit out.
The issue is that it happens as a bug. That someone forgot to put the proper return at some code path, and the function that gets the return value then gets None, rather than the code erroring as hard as when adding a string to a float.
>>
>>100159702
Based
>>
>>100158919
import socket
>>
>>100159702
More like g/tard trifecta lmao
>>
>>100158919
uhhhh I use Pydantic a lot.
>>
>>100169007
Hmm I see what you mean now. That would be better behavior. Unfortunately the ship has sailed so can't change that without making everyone upset (see the 2->3 migration). Fortunately enough there are no shortage of linting tools to complain if you do use such a pattern.
>>
Having a lot of fun with libcst's matchers module to refactor stuff at work. It's the first time I've used a library where things make complete sense and I think "if only I had this..." and then there's exactly what I need in the library.
>>
>>100169930
>NOOOO, WHY DO THINGS IMPROVE
why are pytrannies like this? Literally the easiest language to write and maintain, and they can't handle literally most basic API changes for decades
>>
>>100168801
>meaning a unicode codepoint
no it actually is just an alias for u32 and you should stop coping, tranny
>>
>>100162854
Go is a nigger's tongue
>>
File: 1682687142507.jpg (134 KB, 1023x911)
134 KB
134 KB JPG
I'm enjoying Flask and SQLAlchemy.
>>
numpy I guess
Python is shit though, only good if it's a single file, < 1k lines, and does all the heavy lifting with C
>>
>>100158919
python numbers are slow as shit tho
>>
>>100168634
import pandas as pd

df = pd.read_csv('huge_file.csv')
for row in df.iterrows():
if row['name'] == 'foo':
return row['name']

>>
>>100158919
Replace python with wolrfram programming language and you are correct you faakhead faak
>>
For the first five years of my career, I thought a signed int meant it was signed with a private key and never understood why.
>>
>>100170847
Commit suicide
>>
File: 1713935466300462.jpg (86 KB, 695x741)
86 KB
86 KB JPG
>>100159189
Boobooo!!!
>>
>>100170816
>for row in df doesn't just work without calling any function
this should be a crime
>>
>>100159656
I hate this unfunny fuck's comics
>>
>>100171130
I liked dilbert but I never thought he'd paywall his comics.
>>
>>100165059
jon gjengset? i like him
>>
>>100165122
Nice to see some non-retarded criticism of Python. A breath of fresh air compared to all these anons comparing about indentation. I still maintain that it's pretty well designed overall and the main problem lies elsewhere, but it's hard to disagree with this.
>>
>>100170198
Everyone is like this. See all the crying, pants shitting, and death threats when Lennart Poettering changes the smallest fucking thing in Linux userspace. Or the C23 realloc fiasco. Or the C++ regex clusterfuck. At least Python managed to have the 2->3 transition, many language communities would just keep 2's flaws forever in this situation.
>>
>>100168801
>a character, meaning a unicode codepoint
Oh no no no, who's gonna tell him?
>>
>>100172792
Yesterday I rewrote std::string from scratch because I needed to use it in context where exceptions would wreck everything so I'm not like this.
>>
>>100172834
I mean every community for a popular language/OS/etc. The Python situation really isn't that bad, considering. Every star in the night sky is a Java class that should have been deprecated long ago, and they still can't get a handle on their null shit after Kotlin showed how to solve the problem well a decade ago.
>>
>>100172891
well communities are fucking retarded, in real world people who want to get shit done get shit done, every single software company reinvents the wheel just to keep their code as unmaintainable as possible to others who might try to "steal" it in some way
>>
>>100169930
Well, that's the issue.
This makes 2->3 even more retarded. They broken backwards compatibility large to make print a function and to make "string" what used to be u"string" and what used to be "string" b"string".

Both of which are absolute non-issues compared to all the actual issues the language has they could've fixed in that time which makes me think Guido is a retard and the language is managed by it. They broke backwards compatibility for something this small.

Javascript with strict mode fixed many similar issues and they didn't break backwards compatibility for it but allowed incremental conversion like a sane person because they knew how important maintaining it is. Every comment on the update by Guido suggests he's an idiot to me who should never be managing a programming language.

He actually thought people would “just switch” like rewriting code for such absolutely minor, trivial quality of life improvements was worth it for people. People 3 was a disaster that cost everyone a lot of time and money and it wasn't even used to fix any actual issues with the language that are still causing people time and money because they create hard to trace bugs.

I remember my first bug I got from the fact that Python loops assign rather than create a new scope. I had always assumed it would create a scope because every language does that and because it's the sane thing to do and no documentation on Python loops even explicitly states it unless one tries to search hard for it.

https://wiki.python.org/moin/ForLoop

Nothing here points out that it assigns rather than creates a new scope. There is never a case you would want this behavior and it's insane they didn't fix this in Python3.
>>
>>100173483
>muh heckin backwards compatibility
noone cares about your toy scripts tranny, nothing a sed can't patch
>>
>>100160156
>>100160027
Obviously, because a Unicode codepoint isn't the full 32 bits of space it occupies which is super important for optimization.

If you could simply convert 32 bit integers to characters you could put u32::MAX into a char which isn't just a non-valid char, it's undefined behavior in Rust if you somehow do that with transmute wizzardy.

Why? Because of optimization, the compiler knows a character can't ever be the value of u32::MAX so it can use that value to store other things and does so. For instance Option<char> in Rust takes the exact same space as char itself right now because the compiler uses some of the illegal values char can't ever have to store the None value. If you could put any value into char you could use that value and the compiler in general aggressively uses these unused parts of datatypes to for instance put drop flags into it where it can so all manners of things would go wrong.

The explicit cast is needed because it errors for any integer too large to fit into a char which is only 21 bits, the compiler is free to use the remaining one for other things and it does.
>>
>>100173506
>You can just patch update to Python3 with a sed.
Yeah you never worked at a company on Python code.
Companies had to employ people full time to port from Python2 to python3. Fedora had to employ 3 people full time for three years just to port all the python2 code in the distribution to python3 and this wasn't even the things they used internally from what I could tell from how it was described.

It cost everyone a lot of time and money, it was a disaster and it wasn't even used to fix the actual issues with the language but some absolutely trivial nonsense.

Anyone who defends this is an idiot.
>>
>>100174016
I use Python for toy scripts, cannot imagine working in a company that thinks that equivalent of playing in sandbox is real work.
>>
>>100174093
Well, the reality is that Python is used by real companies though many have said that how Python3 was done did make them lose confidence for the reasons I gave.

Much of the code in operating systems also uses it. Portage and dnf were written in it back when no one could see coming that Guid could actually be retarded enough to break backwards compatibility to make print a function. He actually thought people would jut “rewrite everything” in 5 years? Is he crazy? How could he ever think that would happen?
So all that stuff had to be ported which cost everyone time and money that could've been spent on either writing new things, or fixing serious bugs. It was a disaster and there are actually idiots on /g/ and elsewhere who defend this with:
>You had 10 years to update, you sat on your arse and now you complain

No. Those people were using their time to do other things, they got paid to use their time to do other things. What looks more attractive from the perspective of a manager at a company:
>I can pay people to rewrite existing code that already works, where the rewrite may even introduce bugs and regressions that can cause downtime and lose us money.
>I can pay them to write new code that makes us more money.

Obviously people aren't going to choose the first option. People that think you can just “update your code” are idiots who write code out of pure boredom because they have nothing else to do in life. For most code, it's a case of a manager deciding where to allocate the time and money the company has, which obviously wants to go where it makes the company the most money and rewriting existing code is very low on the list.
>>
>>100174221
Ironically, Portage actually copes correctly and easily with having 30 Python versions on your system. I guess not everyone who uses Python is a total colossal retard. But I did have to switch to pypy3 because these emerge setup times are becoming unbearable
>>
>>100171068
The example I was giving was demonstrating bad coding. If you ever find yourself iterating over a dataframe, you're doing it wrong.
>>
>>100174244
That doesn't mean it itself didn't have to be rewritten.
There is no python2 code in Gentoo any more from what I know but the python2 interpreted is still offered though it's end of line.

I also had to update some of my scripts because things did start to break and surprise surprise months after I changed some of them they were still getting string bugs on obscure code paths. This shit wouldn't be acceptable in production.

It simply cost everyone a retarded amount of time.
>>
>>100173483
You're quite uninformed on the changes between 2 and 3. They fixed quite a few language details to the point that 3 is significantly nicer to use. For example:
- Strings and bytestrings now work in more obvious and less error-prone way
- Print function
- More use of generators, for example in range and zip
- / is floating point division
>>
>>100174385
I would tell you that this is solvable by hiring white people but I guess you wouldn't be using Python if you wanted to do such a thing.
>>
>>100174402
>/ is floating point division
NTA but this one is retarded
>>
>>100174402
Anon, I literally talked about much of that:
in:
>They broken backwards compatibility large to make print a function and to make "string" what used to be u"string" and what used to be "string" b"string".

And no, it wasn't worth it. And these things are all fairly small compared to the issues I raised and many of them are also simply library issues. They could have fixed it like everyone else did: make a new function and deprecate the old one.
In fact they did exist in many cases. They just renamed xrange to range. This is not worth breaking backwards compatibility over and if you do it then do it in a way that allows for incremental updates and old and new code to coexist like every sane language did.

Javascript fixed actual issues that matter and on top of it did it in a way that allowed new code to take advantage while seamlessly intermixing with old code. There was no reason these changes couldn't be applied to a per-file level.

>>100174416
You would be wrong and an idiot
>White people have infinite time and do work instantly
Holy kek.
>>
File: file.png (10 KB, 561x45)
10 KB
10 KB PNG
>>100173555
I still wouldn't mind implicit promotions to signed and larger bits
>>
>>100174468
Yeah, that isn't typologically objectionable. They simply didn't want it because they were afraid it could lead to bugs. It's a tradeof there.

But allowing a u32 to silently convert to char is simply undefined behavior.
>>
>>100174453
>You would be wrong and an idiot
>>White people have infinite time and do work instantly
>Holy kek.
le poor companerino can't afford to hire more people... Biggest cope of all time, I trivially migrated without problems or bugs, but software companies who make money from this unlike me cannot...
>>
>>100174510
They could. It simply would cost them time and money they'd rather spend on things that matter more.

You however seemingly program out of boredom and if Python didn't make new busywork for you, you would be eating out of your nose with nothing to do.
>>
>>100174542
If your business model is making money off infinitely copyable bytes, your work is worthless and everything you do is too and noone will be sad when you are gone.
>>
>>100174575
What the fuck is this cope anon.
Companies used Python2 when no one could have foreseen that Guido would actually pull this crap. They can hardly be blamed for not seeing this coming.
>>
>>100174653
they can easily be blamed for being unable to do in 2 weeks what I did in 2 minutes
>>
>>100174653
Still use Python 2 if you want to use Python 2. There are retarded companies still using long dead versions of C and C++ that are older than most people on this board without issue.
>>
The main problem with python is that it Just Doesn't Work until you tinker with it.
>>100160623
>>100166010
Why do I need "skill" to perform basic tasks? Why can't I just get it installed with one click, with no admin privileges and no platform-specific gotchas, and have all the standard tools that you need installed and working?
The time you save because of python's "simplicity" is nothing compared to the time that people waste tinkering with dependency managers, installers, virtualenv managers etc to get them to actually work.
>actually it works on my debian oldstable machines that I recreate fresh for each project with no dependency management
>actually it just works if install anaconda through chocolatey through the windows store or whatever
>>
>>100174917
I just let portage handle dependencies and python versions, honestly seems like a skill issue at play.
>>
>>100175045
>actually it works, but only on this one linux distribution with this specific 3rd party tool
>>
>>100175111
Is it my fault that there's only one true good package manager that can handle any type of package ranging from strictly prohibited to fetch from network packages all the way to packages compiled on remote server farms in realtime?
>>
>>100174668
You updated a bunch of small scripts. They updated large codebases and were sure to not introduce regressions.
Do you actually think those people Fedora employed to port to python3 were simply incompetent and you were better? They have real concerns and larger codebases to work with that you don't.

>>100174811
Yes, many companies aren't updating in internal use and that's fine.

But obviously Fedora and Gentoo can't in their publicly distributed system have python2 script that rely on an unsupported interpreter that nags users with an EoL message every time it's used.
>>
>>100175165
I'm just a single person, they're large software industry, scale is exactly the same.
>>
>>100175145
No, but it's Python's fault that it can't just work by itself without platform specific external tools doing its own job.
Plenty of programming languages don't have issues like these and just work out of the box on multiple platforms. Why do you think it's okay for a programming language to rely on fucking portage and force you to figure out yet another manager tool as soon as you want to run the code somewhere else?
>>
>>100175214
>it's python's fault that everything ever in all OS'es depends on filesystems and environment variables to work
lol, lmao even
>>
>>100175196
Yes, so they have to allot a team of 10 people for a year and that costs them a lot of money and what's why Python3 was a garbage idea with garbage execution.

You understand that time is a resource don't you? That companies would rather spend that on things that can make them money, fix actual bugs, develop new features, rather than be forced to rewrite things that already work and don't have bugs?

>>100175214
Because like everyone else who defends Python and the switch to 3:
>A lot of time
>programs to kill time, not for money, nor to solve actual problems.
>>
>>100175253
switching to Python3 solved many problems
>>
>>100175270
Like what? Not having to use xrange, u“string”, and having to put braces around print?

The changes were so absolutely minimal and not worth breaking backwards compatibility over.
>>
>>100175240
Again, plenty of languages don't have these issues.
>>
>>100175309
>muh heckin industry destroyed for years
>changes were minimal
can you pick one larp and stick to it?
>>
>>100175323
you're delusional and don't know many languages if you really believe this
>>
>>100175326
That you actually think those two statements are contradictory shows you have zero actual experience with large codebases.

Yes anon, very minimal changes can require a lot of time because every codepath needs to be tested again for errors to ensure nothing was overlooked. Some obscure codepath somewhere might have relied upon range returning a list rather than an iterator and treated it as such and that needs to be tested for before it can be rolled out.

Like I said, 6 months after porting some scripts I sometimes still run into string errors on obscure paths.
>>
>>100175341
I don't doubt that there are a lot of shit languages, perhaps even worse than python, but there's also plenty that actually work. If you want examples, Go and Rust.
Are you really arguing that it's physically impossible to make a programming language that works out of the box?
>>
>>100175405
Rust has editions and if people who program in it will ever have a job (luckily that's unlikely), some of them will be stuck with ancient versions of it depending on when they started and then it will have Python 2 to Python 3 tier problem if they ever dare to upgrade.
>>100175386
Yes they are, if changes are minimal, so is work to fix it.
>>
>>100175431
>minor Rust inconvenience not at all comparable with Python's problems
>no argument at all for Go
I accept your concession. Enjoy your shit language.
>>
>>100175431
>Rust has editions and if people who program in it will ever have a job (luckily that's unlikely), some of them will be stuck with ancient versions of it depending on when they started and then it will have Python 2 to Python 3 tier problem if they ever dare to upgrade.
>Anon doesn't understand how Rust editions work.

You do realize that you can safely upgrade with the 2015 to the latest version right. It's not that it doesn't give you any new features. It only holds back the things that would break backwards compatibility, it otherwise gives you all the new features and introduces the things that would break backwards compatibility in a different way that's less ergonomic. It did it right unlike Python and also to solve a problem that wasn't half as big because it's a statically typed language.

>Yes they are, if changes are minimal, so is work to fix it.

No you idiot. You clearly never worked with a dynamically typed language on large codebases. Even if the only change were how strings worked every single thing still had to be tested to ensure no regressions be introduced.
>>
>>100175465
>>minor rust inconvenience
just like it was a minor Python inconvenience that took me minutes to fix
>>no arguments at all for go
I'm not a resident 12 year old so I don't comment on things I never used.
>>100175477
and it's same thing with Python
>>
>>100175491
>just like it was a minor Python inconvenience that took me minutes to fix
Yes, because you only fixed a 30 line script.
>It... it takes only minutes to update a 100kl codebase guys, I swear...
Do you actually believe your own bullshit?
>and it's same thing with Python
No it isn't. The Python2->3 change was completely different:
>Python2 stopped receiving the new python3 features. The 2015 edition continues to receive all the new features.
>Python3 code can't call python2 libraries. This is the big issue, for a while everyone was burdened with maintaining two different versions of the same library.

Editions are fundamentally different. 2021 code can call and link to 2015 crates with no issue. What edition a crate uses is entirely private and doesn't leak out so it doesn't fragment the œcosystem.

Rust developers, as usual knew what they were doing and Python developers, as usual, are a bunch of drooling monkeys and all the people who defend their madness, as usual, show with every post they write they never made more than a 50 line script in the language.
>>
>>100175641
You're almost right, after all I'm in the process of rewriting my last python script in C++.
>>
>>100159702
The Cnile is immunized against all dangers: One may call out his segfaults and awful build systems and dependency management, it all runs off him like water off a raincoat. But tell him to parse some yaml with a few lines of code and you will be astonished at how he recoils, how injured he is, how he suddenly shrinks back: "Don't need to, I'm unemployed!"
>>
>>100174917
>Create a venv
>pip install xyz
A programming is best left to the white man. It's beyond your curry stained brain.
>>
>>100175253
>Companies would rather use a language that isn't Python
Meanwhile in the real world, in the past 10 or so years, Python has gone from a niche language that's barley used to the 2nd most popular language in the industry (behind js). Pull your head out your ass. Python won, stop seething.
>>
>>100175962
and this is mainly due to Python moving to 3, fixing things can make a dead language into one of most relevant languages, who would've known
>>
>>100175901
>A programming is best left to the white man
>>
>>100159189
This is the type of dogshit that retards write and then say they hate python. Lol
>>
pillow, numpy, pytorch
>>
>>100158919
>i128
what is the future of quadruple precision floats? when are we getting a quad keyword my fellow C++ computational science chads?
https://en.wikipedia.org/wiki/Octuple-precision_floating-point_format
>>
File: dip.png (51 KB, 944x550)
51 KB
51 KB PNG
>>100175962
>>100176090
Python adoption dipped during the switch time.
Besides, it's not like there aren't a lot of terrible language that are very popular. Go also got extremely popular very quickly.
Interface {}
practical void pointers everywhere.
>>
>>100159339
Programming isn't real scripting
>>
>>100176168
>TIOBE index
yeah all the brownoids stopped using it until white people did all the meaningful work for 6 figures, white men don't have to check stack overflow for every problem so it doesn't show up on TIOBE if you know what it measures
>>
>>100176164
you fucking retard, modern processors already have 512 byte registers, stop larping, i128 is like 20 years old, that's possibly older than you because you post like an underage.
>>
>>100176205
except only GCC supports __float128, and if you ever did any real-world work in your life you'd know that a double precision epsilon isn't always sufficient for some scientific computing applications you dumb black gorilla ape nigger.
>>
>>100176297
good thing actual scientific computers don't use floats indeed
>>
>>100174453
>And these things are all fairly small compared to the issues I raised
Not at all. Before Python 3 became ubiquitous, I've had several complain to me that they found Python strings confusing and a constant source of errors. After the transition to Python 3, the complaints stopped. Now, to people who understand encodings well, it may be obvious that you want Unicode strings most of the time, but Python 2's default of having "string" default to bytestring is a terrible default for less experienced programmers. This was a very important fix. The only mistake Guido made was disallowing the legacy u"string" syntax at first, but he relented on that.
You seem to be arguing two contradictory things: that Python 3 broke too much backwards compatibility, but simultaneously that it didn't break enough. That's weird. I agree with the latter. They should have separated variable declaration and assignment while they were doing a big break.
Now that's water under the bridge though, there probably won't be a Python 4 with another round of large changes to the language. I actually do think that there should be a compatibility-breaking Python 4, but not via language changes.

>>100165817
By the way, check out https://github.com/ankurdave/color-identifiers-mode

>>100174917
Use pipx and poetry.

>>100175145
I thought that Nix and Guix can do this kind of stuff too?

>>100175477
That's unclear to people who don't use Rust. Can you explain how it handles backwards-incompatible language changes? You can't have your cake and eat it too, there's always going to be breakage if you change a language in a way that isn't a straight addition.
>>
>>100176454
>I thought that Nix and Guix can do this kind of stuff too?
you thought wrong, one comes with broken trannylang unusable in real world, another is made by GNUtards who are too mentally ill to allow user freedom in installing proprietary software if they want to, on gentoo, by default, the only accept.license is FREE
>>
>>100176507
>unusable in real world
Why? I've heard of companies running NixOS. Not many to be fair.
>>
>>100176535
companies that are as relevant as nixos itself
>>
>>100159339
real scripting has never been tried
>>
>>100176454
>You seem to be arguing two contradictory things: that Python 3 broke too much backwards compatibility, but simultaneously that it didn't break enough.
No, that's a completely valid point.
There is a point where breaking backwards compatibility isn't worth it. And anon argues that it only becomes worth it if you break enough and use it to fix enough things to make it worth it.

>I actually do think that there should be a compatibility-breaking Python 4, but not via language changes.
They could just be sane and allow code to mix and have it work on a per-file basis so people can continue to use the old libraries.
>>
>>100176832
>Guido should support every single version under the sun because I'm lazy faggot
>>
>>100176454
>That's unclear to people who don't use Rust. Can you explain how it handles backwards-incompatible language changes? You can't have your cake and eat it too, there's always going to be breakage if you change a language in a way that isn't a straight addition.
It's simple. Every Rust compiler version can run in multiple editions. All these will continue to be supported till forever, and these work on a per-module basis.

So that latest version of Rust can still work in the 2015 edition, at which point it will get all the new features and changes, except for those that break things from before. But the really important part is that code written with the 2021 edition can still use modules written in 2015, though both can't be used inside of the same module.

This allows new code to be written in 2021 Rust while calling 2015 code which now works, and doesn't have to be rewritten, and it can all be compiled with the same compiler that will apply all the new optimizations provided they not break things.
>>
>>100176868
Other languages do that.
Breaking compatibility is not something people play fast and loose with in general.
As Linus said:
>We don't break userspace.
>>
>>100170198
Python 3 uses arbitrary precision numbers which are gay and slow
>>
>>100176905
>adds rust support to ensure that userspace will eventually be broken beyond repair with Linux eventually not compiling at all before you bootstrap GCC then compile LLVM and then Rust.
>>
>>100165657
you can also set notepad++ the set the right amount of whitespace when using tab
>>
>>100159656
do people think this is funny?
>>
>>100177715
emacs users definitely do
>>
>>100176454
>Can you explain how it handles backwards-incompatible language changes?
The short answer is they don't make backwards-incompatible language changes because they're not retarded.
>>
>>100158919
I did both a mildly complex software with python and some shitty script to automate the import of modules from a swagger API endpoint. If I have to be fully honest with you, I would rather develop a raging mold patch that constantly itches the tip of my cock rather than writing anything in python that is made up of more than 1 file. In hindsight, I would probably know how to avoid many of the pitfalls I fell into, and in spite of that I still wouldn't do it. Quite literally anything else is preferable.
>>
>>100162854
this is the truth
>>
>>100174337
sometimes its necessary but yeah 99% of the time if someone iterates through a df its because they didnt read the docs
>>
>>100176168
>dipped then exploded
nigger what are you even trying to argue against
>>
>>100159702
>C, Lua, and Bash
Based but you are memeing so cringe >>100162854
>the perfect trifecta is C++, Go and Python
Now this is BASED
>>
>>100179618
Why do you need Go and Python? Surely one or the other.
>>
bs4, numpy and pyplot
so handy and convenient, cirgins could never
>>
>>100160201
This. There are many good languages but python's simplicity, practicality and directness is like a warm fuzzy comfy blanket.
>>
>>100162895
I like this take. I have a soft spot I admit for C++ and Java and I want to make a biggy project in Go to form a better opinion on it (so far I like go a lot but I'm a noob in it) but Python is just the best and as you grow older it just gets even better because it doesn't waste energy on some retarded trivial shit, unlike rust which is just the peak of retardation. I'm looking forward to the GIL removal.
>>
>>100163595
>lua
>arrays
They are tables, not arrays.
And it makes sense for what they are too start their keys at 1.
Furthermore you can always be explicit and start at 0, 1, -1, 42, or whatever the fuck you want, so stop complaining for something that is not wrong with Lua and is actually one of the good things Lua has to filter the retards.
Your opinion goes in the trash.
Your
>>
>>100164005
>Loop variables assign rather than create a new scope
Ok, that's a valid and nice criticism
>Every value can be used in a conditional and random arbitrary values test as false. If you want to be able to use every value then at least make only False and None test as false.
Again it's a valid point and often when I write an if I take a small pause to think how an empty structure well evaluate and if I'm ok with it and then I tweak the type annotations and I'm happy, I kinda like this implicitness but I also get why it may not be good either
>functions that reach the end of their body without returning return None
How's that a problem?
>default values in function arguments are executed at function definition time, not when the function is called
That's an epic gotcha of Python and you are awesome for bringing it up. Personally I always use immutable values as default arguments, e.g
foo: list[str] | None = None
. Btw python made the perfect choice on making strings immutable, unlike ruby.
>initialization and assignment of variables shares the same syntax
I don't get this, could you share some pseudocode of how you want it to be?

Great post btw!
>>
>>100179900
>makes sense to start at 1
Not really. Lua was made to be embedded in C(++) programs. It doesn't make sense to start your arrays at a different index than the language you plan to interop with. That just sounds like a way to get pointless bugs. 0 also makes sense sense because in memory an array is just a set of things that are the same data and the array is just a pointer to the first element. You will force pointless subtraction in order to actually index into the correct spot. That or you are pointing to memory behind your array which is also stupid. Lua should just conform to what is standard instead of trying to be a unique snowflake.
>>
>>100165061
Good point but by having strict mypy type checking I have the type annotation act as a form of initialization and usually the ide auto complete catches the typo. A python strict mode could be nice though.
>>
>>100165122
>It would throw an exception obviously to try to use the return value from a function that reached the end without returning.
True, I had a print() print none because I forgot during a refactor that I modified a function to not return anything. It would be nice if mypy would catch this but there is an implicit return None which goes against the zen of python.
>>
>>100165122
I find it interesting that C differentiated between void and null and python merged these two different concepts into None. A mistake from Guido.
>>
>>100167064
BASED.
I made some generic data structures in C with automatic memory management via a box/unbox mechanism and I was casting everything to void* like a boss.
>>
>>100180065
>I don't get this, could you share some pseudocode of how you want it to be?
Python right now has a really weird model:

When you assign to a variable that does not exist in the current scope, it creates that variable in the current scope. One has to use strange things like nonlocal to assign outside of the current scope.

In say Javascript,
var name = "initial value";
is used to define a new variable with initial value in the current scope. Any further references to “name” will now reference the current scope rather than the outer scope.

The obvious issue with Python's approach is that a simple typo in what was meant to be an assignment creates a new variable silently and effectively an irrelevant operation, leading to all sorts of easy bugs. This should be an exception of trying to assign to a nonexistent variable as Javascript does nowadays, unless of course a variable with the same name as the typo happens to exist, but nothing can be done about that.
>>
>>100176886
I don't understand what you mean here.
>So that latest version of Rust can still work in the 2015 edition, at which point it will get all the new features and changes, except for those that break things from before.
But regarding the rest of your post, you mean that it's basically like compiling some files in a C project with C89 and other with C17 and then linking them together?
How would you implement something like this in Python? Perhaps make Python 3 support
import __past__

which would switch the parser into a mode that parses "string" as b"string", u"string" as "string", range(...) as list(range(...)), etc.?

>>100179900
>They are tables, not arrays.
Exactly. It's one of the most retarded language design choices I have ever seen. An endless source of errors for zero gain.

>>100180540
How would you handle declaring a variable without assigning it, for example
var my_variable
if predicate():
my_variable = 1
else:
my_variable = 2

Would you just ban it, or internally give it some kind of poison value that raises an exception when accessed?
>>
>>100180946
>But regarding the rest of your post, you mean that it's basically like compiling some files in a C project with C89 and other with C17 and then linking them together?
>How would you implement something like this in Python? Perhaps make Python 3 support
Yes, that's pretty much what it is yes.

>How would you implement something like this in Python? Perhaps make Python 3 support

Modules would have to declare which version they used and then bindings are different in that module yes.

>How would you handle declaring a variable without assigning it, for example
>Would you just ban it, or internally give it some kind of poison value that raises an exception when accessed?
Either is honestly fine. It could even be None by default in this case honestly.

In Rust it's actually statically decided whether a variable is assigned before accessed on each code path due to lifetime and drop semantics it's often actually needed to declare a variable in an our scope and to extend it's lifetime but only first assign and initialize it in an inner scope.
>>
Has any successfully got PyQt6 to run on their machine? I've tried it on both my Mac on Python 3.12 and my Win 11 work PC on Python 3.9 and both have issues with either missing DLLs or similar. Also, do I need to pay these fuckers if I use PyQt for an interal project at work?
>>
>>100181845
why not PySide instead?
>>
>>100181941
No idea, I am almost purely back end, but I wanted to create desktop app for my boss with a couple of drop down options he can use to run reports, rather than pestering me to run them from them from thd command line with different params.
>>
>>100158945
>received many thanks
Do you pay your bills with thanks?
>>
>>100182112
PySide is the official python QT library made by the QT group itself, so if you want to keep the same workflow maybe see if that works
what youre describing might be simple enough to use Tkinter which is simpler to deal with
DearPyGUI is probably easier to use than both and looks quite nice (python version of Dear ImGUI)

also you dont have to pay for a license for internal projects
>>
>>100181845
>Also, do I need to pay these fuckers if I use PyQt for an interal project at work?
Of course not. The GPL doesn't require you to make source code publicly available for software that is only used internally.
Godspeed getting this shit to work though. I only really managed to get it to work on Linux.
>>
>>100182229
Perfect, I'll try this tomorrow. The docs on www.pythonguis.com seem really good, so hopefully shouldn't take me too long to get up to speed.
>>
>>100160253
Bruh the sqlite3 standard module for example is indeed a library, what are you talking about lmao
>>
>>100181845
I'm on Linux and Qt 6 works flawlessly out of the box. I just created a venv,
pip install pyside6

and started writing the code.
>>
>>100181845
>>100183575
Also, GPL and LGPL shouldn't be a problem if you're making a thing for your boss only. It's not like the GPL has a provision that says you have to post the code on GitHub. It only says something like, "if you give someone the binaries, you have to make it reasonably easy for them to get the source too". And well, your boss probably has access to the source anyway.
>>
>>100164377
started programming in 2015, graduated in 2022 and I still have yet to write a single line of python kek
>>
>>100160378
Both. Most of them are Arabs or Indians.
>>
>>100184292
So he's right about you?
>>
>>100158919
pandas and pytorch are the only use cases for that abomination of a language.
>>
>>100184428
Both of these libraries actually just use cpp when you’re not looking
>>
>>100184292
so you took a programming class as a high school freshman, went through college, and throughout that time you never actually worked on personal projects because youre a mindless drone
congratulations
>>
>>100158919
import imafaggot
>>
>>100158919
just f64 everything, does the same job.
>>
>the python general is the most civil thread on /g/
Maybe we really are the chads of the programming world
>>
>>100158919
itertools
>>
>sqlite3
>json
>re
>flask
the holy stack
>>
>>100181845
That's a very typical experience unfortunately. If you want your code to actually work I suggest you stay away from both Python and C++. Maybe try Go or Rust.
>>
>>100168527
>>100159091
Thank you, i will look into these options once I've been there long enough to be able to request stuff from the telecom.
>>
>>100172821
Whatever you are implying, I already know. At some point you need a fixed size denominator common for all characters, and a codepoint is that.
>>
>>100170248
char is it's own primitive type in rust
>>
>>100175431
Editions are intercompatibile. You can call code 2015 edition code from 2021 edition code.
>>
>>100158919
venv

I use it all the time
>>
>>100186701
LARPER ALERT LARPER ALERT
>>
>>100187130
>Whatever you are implying, I already know.
Well, I doubt it. Otherwise you wouldn't call a code point a "character", which is retarded.
>>
>>100158919
I love toml, pydantic, and sqlite3. Thanks to them, I can avoid creating custom parsers and serializers, while actually getting better results.
I hate YAML because it's so complex, implicit, and full of pitfalls, but TOML hits the sweet spot. I use it for almost all config files now. I just parse it and run it through pydantic for validation.
And sqlite3 is a godsend for cache files and data export. I no longer need to make up some format when I want my GUI program to save data, I just come up with some SQL tables and save it with SQLite. That's also easier to debug and gives me amazing consistency guarantees for free. I just wish it had a global "very strict mode", but oh well, can't have everything.
Bonus mention goes to argparse. It creates nice command line interfaces, but it doesn't get the top spot in this post due to two flaws: there's no way to make it parse strictly left-to-right, and it doesn't have a built-in way to make --help include the flags for all the subparsers too.
Second bonus mention to multiprocessing, it's a lot more convenient than the concurrency utilities in most other languages.
>>
I wish we could finally get rid of the retarded C API and replace it with a decent one. It's the one thing that could sink the otherwise great language.
>>
>>100166061
You're new to programming and system administration? Here's some quick advice from someone who's been doing it for quite a few years.
- Version control your stuff. Use a consistent commit style, I prefer https://cbea.ms/git-commit/ . The version control system should probably be git, it's not the easiest but it's powerful and it's what most programmers use. Learn it to a decent level, you don't need to read the entire Pro Git book but you should know what is a commit, fetch, rebase, merge, merge conflict, HEAD, hard reset, soft reset.
- You can use git in a fully decentralized way, just exchanging commits between people, but it's easier to have a central place with all the repos. Self-hosted GitLab is good for that. It can give you an interface similar to GitHub, but without the data ever leaving your company's servers.
- Have a central place that you can consult to know how things have been configured. Personally, I've gone a step further and I do everything with Puppet and containers so it doubles as docs and executable instructions, but if you don't want to do that, at least have an internal wiki where you document how you've set things up. Otherwise, sooner or later you'll have a situation where you configure a server, leave it untouched for a year or more because it works fine, and then you need to change something but you no longer remember how it works. That turns into basically computer forensics and takes waaay longer than it would have taken to just document things as you go.
- When programming in a language, stick to a coding style considered idiomatic by that language's community unless you have a good reason not to. For Python, that's PEP8.
- Use an advanced and configurable editor. I use Emacs but recommend Visual Studio Code to beginners.
- Configure your editor to constantly run a syntax check + linter in the background and highlight problems like Word highlights misspellings. For shell I recommend shellcheck, for Python - pylint.
>>
>>100158919
being slow lole
>>
>>100190561
*pypy3 has entered the chat*
>>
>>100158919
cffi
>>
>>100191674
why not cython?



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.