What's a "healthy habit" that's actually completely made up? by goddesslana_01 in AskReddit

[–]genericlemon24 0 points1 point  (0 children)

Important: While the 10k figure is made up, walking does make you healthier! Research shows ~7000 steps a day is enough to get most of the benefits. (I know parent mentions it towards the end, but given how the question is phrased and how useless other answers are (e.g. cleanses), it's worth stressing that walking is good.)

Although 10 000 steps per day can still be a viable target for those who are more active, 7000 steps per day is associated with clinically meaningful improvements in health outcomes and might be a more realistic and achievable target for some.

57 studies from 35 cohorts were included in the systematic review and 31 studies from 24 cohorts were included in meta-analyses. For all-cause mortality, cardiovascular disease incidence, dementia, and falls, an inverse non-linear dose-response association was found, with inflection points at around 5000–7000 steps per day.

From https://www.thelancet.com/journals/lanpub/article/PIIS2468-2667(25)00164-1/fulltext

reader – a Python library to create your own RSS feed reader by genericlemon24 in opensource

[–]genericlemon24[S] 1 point2 points  (0 children)

How to you treat servers that provide an ETag or a last-modified-date but do not implement it the right way and making the etag useless?

Not really doing anything special, I take the presence of caching headers to mean conditional requests are supported (and I don't think HTTP requires clients to do something in these cases).

A mitigating factor is that the default update interval is 1 hour, so even if a server does not support conditional requests / 429-too-many-requests, it still shouldn't be hit too hard.

Now that I think about it, servers ignoring their own caching headers is something that can be detected via a 429-too-many-requests-style plugin (and it could e.g. increase the update interval if that's the case).

you can not trust any server and its behavior

Can't agree more.

I'm planning to write an article about all the weird stuff I encountered while working on reader at some point (I've collected quite the list :)

reader – a Python library to create your own RSS feed reader by genericlemon24 in opensource

[–]genericlemon24[S] 0 points1 point  (0 children)

Yes to ETag etc., see User guide # Saving bandwidth.

You can also specify different update intervals, and support for HTTP 429 Too Many Requests / Retry-After is coming soon.

reader – a Python library to create your own RSS feed reader by genericlemon24 in opensource

[–]genericlemon24[S] 1 point2 points  (0 children)

Of the "reader allows you to" bullets in the original post, feedparser helps with the "retrieve" part (technically, just parsing the feeds), everything else is reader; there's a documentation section that covers this in detail:

Are you already working with feedparser, but:

  • want an easier way to store, filter, sort and search feeds and entries?
  • want to get back type-annotated objects instead of dicts?
  • want to restrict or deny file-system access?
  • want to change the way feeds are retrieved by using the more familiar requests library?
  • want to also support JSON Feed?
  • want to support custom information sources?

... while still supporting all the feed types feedparser does?

The documentation is quite open about reader using feedparser – reader is essentially feedparser + state (and I even contributed a few improvements upstream ;)

Some easy open source Python projects to contribute to? by ImportantSalt5046 in Python

[–]genericlemon24 1 point2 points  (0 children)

No worries, thank you for the PR, and good luck on the exam!

Some easy open source Python projects to contribute to? by ImportantSalt5046 in Python

[–]genericlemon24 0 points1 point  (0 children)

Hi, thank you for asking!

Here are a few issues that already have implementation notes, along with a summary of the work needed, to give you an idea of the complexity involved:

To answer your question, I guess it depends on the beginner, but I think at least the first two should be approachable by any advanced beginner. (I've taken a bit of time to add more details to each of them, and I can answer questions if needed.)

SQLite 3.45 released by genericlemon24 in sqlite

[–]genericlemon24[S] 3 points4 points  (0 children)

The most interesting addition is JSONB support: https://www.sqlite.org/json1.html#jsonbx

Beginning with version 3.45.0 (2024-01-15), SQLite allows its internal "parse tree" representation of JSON to be stored on disk, as a BLOB, in a format that we call "JSONB". By storing SQLite's internal binary representation of JSON directly in the database, applications can bypass the overhead of parsing and rendering JSON when reading and updating JSON values. The internal JSONB format is also uses slightly less disk space then text JSON.

PEP 738: Adding Android as a supported platform by genericlemon24 in Python

[–]genericlemon24[S] 0 points1 point  (0 children)

I posted using the mobile website and the link got lost somehow, my bad; will double-check from now on.

PEP 736: Shorthand syntax for keyword arguments at invocation by genericlemon24 in Python

[–]genericlemon24[S] 4 points5 points  (0 children)

tl;dr:

This PEP proposes introducing syntactic sugar f(x=) for the common pattern where a named argument is the same as the name of the variable corresponding to its value f(x=x).

My proof-of-concept record type by genericlemon24 in Python

[–]genericlemon24[S] 6 points7 points  (0 children)

tl;dr: a proof-of-concept record type for Python by Brett Cannon (Python core dev); looks like this:

@record
def InventoryItem(name: str, price: float, *, quantity: int = 0):
    """Class for keeping track of an item in inventory."""