Thanks for sharing. We use all pytest-style tests using pytest fixtures. I’ll keep my eyes open for memory issues when we test upgrading to python 3.12+.
Very helpful info!
I like programming and anime.
I manage the bot /u/[email protected]
Thanks for sharing. We use all pytest-style tests using pytest fixtures. I’ll keep my eyes open for memory issues when we test upgrading to python 3.12+.
Very helpful info!
I’m most excited about the new REPL. I’m going to push for 3.13 upgrade as soon as we can (hipefully early next year). I’ve messed around with rc1 and the REPL is great.
Do you know why pytest was taking up so much RAM? We are also on 3.11 and I’m probably going to wait until 3.13 is useable for us.
EOL for 3.8 is coming up in a few short weeks!
So cool!! Mercury is definitely the most mysterious inner planet due to its difficulty to get a space probe there even though it’s the closest planet.
The spacecraft will arrive next year, and I can’t wait for all the Science it will uncover!
TIL this exists
I also like the POSIX “seconds since 1970” standard, but I feel that should only be used in RAM when performing operations (time differences in timers etc.). It irks me when it’s used for serialising to text/JSON/XML/CSV.
I’ve seen bugs where programmers tried to represent date in epoch time in seconds or milliseconds in json. So something like “pay date” would be presented by a timestamp, and would get off-by-one errors because whatever time library the programmer was using would do time zone conversions on a timestamp then truncate the date portion.
If the programmer used ISO 8601 style formatting, I don’t think they would have included the timepart and the bug could have been avoided.
Use dates when you need dates and timestamps when you need timestamps!
Do you use it? When?
Parquet is really used for big data batch data processing. It’s columnar-based file format and is optimized for large, aggregation queries. It’s non-human readable so you need a library like apache arrow to read/write to it.
I would use parquet in the following circumstances (or combination of circumstances):
Since the data is columnar-based, doing queries like select sum(sales) from revenue
is much cheaper and faster if the underlying data is in parquet than csv.
The big advantage of csv is that it’s more portable. csv as a data file format has been around forever, so it is used in a lot of places where parquet can’t be used.
They’re asking for TV manufacturers to block a VPN app in the TV. Not to block VPN in general.
While it would be ideal to have all datetime fields in databases and other data stores be time zone aware, that is certainly not the case. Also, SQLite (and probably others) do not have great support for time zones and it’s recommended to store datetimes as UTC (typically unix timestamps).
Deprecating utcnow
was a good idea, but they should have replaced it with naive_utcnow
. Oh well.
The first way to use it is with any type annotation: you just use it for documentation.
# int annotation
def add_1_to_number(x: int) -> int:
return x + 1
# callable annotation
def printer(x: int, func: Callable[[int], int]) -> None:
results = func(x)
print(f"Your results: {results}")
These type annotations can help document and make editors parse your code to make suggestions/auto-complete work better.
The second way to use it is by creating a callable. A callable is an abstract base class that requires you to implement the __call__
method. Your new callable can be called like any function.
class Greeter(Callable):
def __init__(self, greeting: str):
self.greeting = greeting
def __call__(self, name: str):
print(f"{self.greeting}, {name}")
say_hello = Greeter("Hello") # say_hello looks like a function
say_hello("jim") # Hello, jim
I’m shocked.
Rocky Linux have said that they can rebuild using publicly available sources in UBI containers and cloud images.
https://rockylinux.org/news/keeping-open-source-open/
Though reading the article, I don’t know if SUSE is simply rebuilding or forking. In any case, it’s cool to see SUSE committed to open source principles.
"I can read this Perl scrip"t should translate to “I’m lying”.
I’ve used pyenv
for years and it’s an awesome tool. Keeps python binaries separate and it has a virtualenv
plugin. I’ve gotten others to use it as well.
It works great for library owners who need to run tox/nox on multiple versions of python in test suites. Love it.
pyenv
also has this with the .python-version
file which will switch versions. And with the plugin, you can use virtualenvs in pyenv so that a .python-version
can be simply: my-cool-project-virtualenv
and switching to that directory automatically switches to it.
Most of us have bad memories of over-complex hierarchies we regret seeing, but this is probably due to the dominance of OOP in recent decades.
This sentence here is why inheritance gets a bad reputation, rightly or wrongly. Inheritance sounds intuitive when you’re inheriting Vehicle
in your Bicycle
class, but it falls apart when dealing with more abstract ideas. Thus, it’s not immediately clear when and why you should use inheritance, and it soon becomes a tangled mess.
Thus, OO programs can easily fall into a trap of organizing code into false hierarchies. And those hierarchies may not make sense from developer to developer who is reading the code.
I’m not a fan of OO programming, but I do think it can occasionally be a useful tool.
If the work I’m doing is on a feature branch on remote or locally, why does it matter to the rest of the team? My integration steps can be done on a server instead of locally. TBD forces teams to collaborate synchronously since changes are pushed straight to trunk. Rebase or squashes are irrelevant here.
Another poster put it great: TBD is trying to solve a culture problem. Feature branches and pull requests into main is much more flexible. The only time TBD make sense is for small teams - like 2 or maybe 3. And even at 2, I’d much rather create feature branches that merge into main.
Precisely. In practice, trunk based development just means your branch is local instead of on remote.
Really cool. This was sorely needed for a while, and I’m glad that someone is taking the mantle to provide this valuable service to the Python community. As Seth mentions in his previous post, supply chain attacks are becoming more concerning. Great that the PSF has hired someone specifically for these types of issues.
PSA for Debian Testing users: read the wiki
https://wiki.debian.org/DebianTesting
Control-F
security
returns 18 results. This is well known and there’s even instructions on how to get faster updates in testing if you want.