Earlier quoted context omitted.
Maybe you're right. Maybe there are applications where this really matters. All I can say is that I have never once had that problem since I started using Python (circa version 2.4). It has always been fine. For example, when dealing with .csv files created with MS Excel, you get strange characters because Excel uses CP1252 encoding, not ASCII. They never tripped up my app in python 2.7. It happily passed them along.…
> Even regular expressions worked. Did you try doing regular expressions for non-ASCII characters? For example, given a file "latin1file" containing the string "L£", encoded in Latin-1, Python 2 will fail silently: $ python2 -c 'import re; s = open("latin1file").read(); print(re.search("L", s));' $ python2 -c 'import re; s = open("latin1file").read(); print(re.search("£", s));' None Python3 forces you to deal with th…
Drawbacks of Python
111–117 of 117 posts
Re: Drawbacks of Python
#112Earlier quoted context omitted.
conda solves that for python at least as well as npm/yarn does. I don't understand while it is not in wider use (except for lack of PR).
If you want to add your own project to Conda, you need to use conda forge, because Anaconda itself is a curated distribution. Maintaining a conda forge package has been, for us, a complete nightmare. If you depend on another conda-forge package you can have the issue that the library is configured to suit whoever first wrote the conda-forge package - i.e. by disabling parallelism or providing only shared/static libra…
Re: Drawbacks of Python
#113Earlier quoted context omitted.
for all of these same issues, using a decent editor and a linter saves approximately the same amount of work. every time this discussion comes up, it's clear that people simply aren't willing to accept that this is a solvable problem, despite the many people who always come out of the woodwork to insist that we've solved it. Is it really that hard to accept that someone out there may have solved something you haven't…
As people have said in other comments, no static analysis can read your mind. You can have valid Python that contains logic errors due to indentation mistakes, and you can only catch it at runtime. Period. That said, everything is a trade-off. Semantic whitespace has downsides, but if the upsides outweigh, then it's a great idea. At this point, I have no idea what the upsides are, other than saving a few keystrokes (…
Re: Drawbacks of Python
#114Earlier quoted context omitted.
Having a bit of experience with Python, I’d say it doesn’t exemplify > Special cases aren't special enough to break the rules. > There should be one-- and preferably only one --obvious way to do it. Python is complicated enough that the language and standard library often have multiple ways of doing the same thing. And there are still a number of “special cases” in the language, or at least non-intuitive results. Cer…
This is the way I feel too. Python is both redundant and inconsistent at a basic level. The APIs for `map`, `filter` and `reduce`, the inversion between `split` and `join`, `sort` vs `sorted` -- it's all very weird. And these aren't advanced features. When I hear people describe Python as simple and elegant, it feels like they're using a different language than the one I know.
The difference between split and join is kind of weird, I'll grant. I'm not sure why it was done that way.
`sort` is in place. You're telling an object to order itself: "hey you! Sort yourself!" `sorted` returns a copy of an object, but... sorted. You're asking for the sorted version of that thing.
Re: Drawbacks of Python
#115Earlier quoted context omitted.
conda solves that for python at least as well as npm/yarn does. I don't understand while it is not in wider use (except for lack of PR).
If you want to add your own project to Conda, you need to use conda forge, because Anaconda itself is a curated distribution. Maintaining a conda forge package has been, for us, a complete nightmare. If you depend on another conda-forge package you can have the issue that the library is configured to suit whoever first wrote the conda-forge package - i.e. by disabling parallelism or providing only shared/static libra…
Re: Drawbacks of Python
#116Earlier quoted context omitted.
If C and Perl are your comparison points, obviously python will seem better...
I have tried golang, Java, C++, js and recently rust. I can still confidently say python code is the most readable of them all. Indeed so much so that python style is adopted by swift language and it does look cleaner than others. Obviously I like concise perl, Haskell code too they have a beauty of their own, but that does not make python whitespace is bad. It's just people who feel it's a burden to explicitly follo…
Re: Drawbacks of Python
#117Earlier quoted context omitted.
I have the same two complaints. I’ve automated some large tasks at my job with Python, and avoided external dependencies because while I’m sure I could deal with it, nobody else here is a programmer and it don’t think it would go well if someone had to try and figure that out later. “Install python (3.6 or later), point script at the csv file” avoids that complexity. It’d be better if it were a self contained executa…
if you just want to make a self contained executable for windows users I've used py2exe a few times and it always works well. It's basically one command and it gives you an exe of your .py file https://pypi.org/project/py2exe/
Reimplementing - in a buggy incompatible way - the Windows loader (which is what that code is doing) from scratch, is a gross hack and should not be used to build anything that's meant to be reliable.
Note that pyinstaller and cx_freeze do not suffer from these issues. Do not use py2exe.