Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
saila
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
saila
2y ago
I don't think Python is special in this regard. I have the same issue with .NET/C# stack traces. With Python, you can run your program under pdb, which will automatically enter break on exceptions, and you can easily print locals.
32.
▲
by
saila
2y ago
This is awesome. Here are a couple bits of feedback: - It took me a while to find the Metadata tab to edit a request's name, I guess because I don't think of the name and description as metadata (even if in a technical sense they
33.
▲
by
saila
2y ago
Considering how important style is in most genres, I think the swipe interface could be a good way to quickly find better potential matches, assuming there's a pre-filter based on your selected genres. If I was looking to start a band
34.
▲
by
saila
2y ago
The general rule I use is that libraries should not specify upper bounds on dependencies but applications should. I use Poetry for all my projects, but I agree that it exacerbates the issue somewhat with its default npm-style version syntax
35.
▲
by
saila
3y ago
I've recently started using Lighthouse to test sites for accessibility compliance, and you can easily get a score of 100 without actually addressing all the accessibility issues a site might have. So, if you're not conscientious,
36.
▲
by
saila
3y ago
I used to be one of those devs, thinking I had the most beautiful coding style. When I embraced formatters, I started spending so much less time and effort keeping the style "correct" and worrying about how other people on the t
37.
▲
by
saila
3y ago
I'm typically looking at the top half of one person's head, the side of a few other people's, and probably up someone's nose. Any time there's eye contact , it's extremely bizarre/unsettling. The idea tha
38.
▲
by
saila
3y ago
I was an occasional smoker for over a decade and only got addicted to nicotine when I started vaping. It's more anecdata, but I don't think vaping is any less addictive than smoking cigarettes, and for many people vaping will incr
39.
▲
by
saila
3y ago
I was just looking at the status of IronPython, and it's on Python 3.4 , which has been end-of-life for nearly five years. I'm not sure that indicates practical usability for most developers. Only C#, VB, and maybe F# actually
40.
▲
by
saila
3y ago
I've been learning .NET recently and there are several choices for building a webapp, such as MVC, Razor pages, and Blazor (further split into server vs web assembly). MVC uses Razor views , Razor pages use Razor pages , and Blazor u
41.
▲
by
saila
3y ago
I use pyenv myself, but that is beside the point. The two examples above are using different strategies to install python3 versus pypy. A valid comparison would use a package manager for both or pyenv for both.
42.
▲
by
saila
3y ago
For a more apples to apples comparison, you would install pypy using your package manager, e.g. apt install pypy3 or brew install pypy3 . On Linux, you might have to add a package repo first.
43.
▲
by
saila
3y ago
I haven't used it, but there's at least one active Angular meta framework: https://analogjs.org
44.
▲
by
saila
3y ago
They support SSL because some browsers force https, but they then force a redirect to a non-SSL page. Seems reasonable. I think I may be missing the point of this being posted on HN. Does it cause issues in certain workflows or something?
45.
▲
by
saila
4y ago
Coming from a mostly-Python background myself, I'm curious if you've looked into F# for this. It's succinct like Python, gives you type safety, and you can use .NET libraries.
46.
▲
by
saila
4y ago
Your comment is quite unnecessarily vitriolic, but I do love the notion that it's possible to become cool by learning a new programming language. Besides, all the common languages we use now, whether or old or new, have all gone thro
47.
▲
by
saila
4y ago
I don't think it's fair to say Rust is a "latest craze" language. Maybe five years ago, but not now. Numerous tools have been (re)written in it and supplanted old tools in at least some cases. Additionally, there are rea
48.
▲
by
saila
4y ago
I use `pip install --user pipx` to install pipx, but I think a better option when using homebrew would be `brew install pipx`. With the latter, doing a `brew upgrade` should keep python and pipx in step. EDIT: Thinking about this some more,
49.
▲
by
saila
4y ago
If you don't mind adding a pyproject.toml, you could use pipx[1] to install these scripts. The directory structure would look like this: <name>/ pyproject.toml <name>.py The pyproject.toml woul
50.
▲
by
saila
4y ago
I don't think there's a consensus, but there are some good modern options. I think poetry is a good choice, and it seems to be fairly popular. I use it for all my Python projects and haven't found a compelling reason to switc
51.
▲
by
saila
4y ago
You can do something similar in Python: utf8_bytes: bytes = bytes(input_string, encoding="utf-8") # Perform the conversion from one encoding to the other. unicode_string: str = str(utf8_bytes, encoding="utf
52.
▲
by
saila
4y ago
It's not that complicated nor is it a Python specific issue. This is a good article on the topic: https://www.joelonsoftware.com/2003/10/08/the-absolute-minim... A simplistic summary is that you always
53.
▲
by
saila
4y ago
You can do the same kind of thing in Django. The approach is a little different, but it's the same basic idea. https://docs.djangoproject.com/en/4.1/topics/db/managers/#cu...
54.
▲
by
saila
4y ago
Using a typical set of Post & Comment models, where Comment has a foreign key to Post, I couldn't figure out how to do this with just a single query in Django. Using prefetch_related, the 2-query version is pretty straightforward:
55.
▲
by
saila
4y ago
You could probably get this down to two queries, one for posts and one for comments, if you aggregate the vote count when retrieving the comments. I think this is pretty easy to do with most ORMs. You could also get it down to 1 query using
56.
▲
by
saila
4y ago
You can delete references to any object in Python, including functions: >>> def f(): None ... >>> del f but it's pointless to try to manually manage memory in Python in most cases. If you're pr
57.
▲
by
saila
4y ago
Why do your anonymous functions have to live far from where they're used? What's the non-aesthetic difference between this: def func(g_func, a, b): g_func(a, b) def scope(): c = "c" def
58.
▲
by
saila
4y ago
I've been using the same rechargeable Wahl clippers for about a decade and only shave with a razor on rare occasions because the clippers get close enough for most situations. It's also possible to repair them to some extent. I&#x
59.
▲
by
saila
4y ago
Not saying SQLite wasn't the issue here (impossible to tell based on the information provided), but I've seen a lot of webapps with highly inefficient queries because developers either didn't understand what the ORM was doing
60.
▲
by
saila
4y ago
If you type `func "arg"`, you get a generic syntax error. If you type `print "arg"`, the syntax error is a bit more informative, but I wouldn't say that the compiler "understands" what you mean . It'
More ›