#stdlib

Hacker Newsh4ckernews
2025-10-03

Stdlib: A library of frameworks, templates, and guides for technical leadership

debuggingleadership.com/stdlib

Hugo van Kemenadehugovk
2025-04-07

Brand new PEP by @emmatyping to add Zstandard to the standard library:
peps.python.org/pep-0784/

Will it make it in to 3.14 before the feature freeze on 2025-05-06? It'll be close but it's possible!

The PEP also suggests namespacing the other compression libraries lzma, bz2 and zlib, with a 10-year deprecation for the old names.

Join the discussion to give your support, suggestions or feedback:

discuss.python.org/t/pep-784-a

Seve_py :vim: :python:seve_py@fosstodon.org
2025-03-01

ePub derived from a specialized Anki deck with integrated Python REPL, focusing on the Python Standard Library. pin.it/6vMDXKvoj via @pinterest
#epub #ebook #python #anki #stdlib

Some Bits: Nelson's Linkblogsomebitslinks@tech.lgbt
2024-11-29

Unix buffering: The clearest explanation I've ever seen about line buffering, block buffering, and tty output vs simple file / pipe
jvns.ca/blog/2024/11/29/why-pi
#buffering #stdlib #linux #shell #unix #cli #+

@astraluma

It depends on what, exactly, you want. time.localtime() will give you a value in the system's configured #timezone. time.gmtime() will give you #UTC. The difference between those will tell you the current local time's offset from UTC.

If you want the name of the configured timezone, on many Unix-type systems, you can read /etc/timezone to get it.

If you want more specific info about a timezone, you can add an external dependency which includes (or provides access to a system-provided) database of timezone info. This stuff changes often, and is decided politically rather than technically, so it's a moving target and the #Python #stdlib doesn't try to include it. `pytz` is one such package with a fairly complete database.

And you can easily override any of these in a test framework. Using unittest.mock.MagicMock(), for example, lets you override any of the above with whatever value you want those functions to return.

#pytz #test #mock #MagicMock

Una apparente #maledizione si è appena abbattuta su di me oggi: non riesco a far funzionare un #programma C!!! 😭️

Il problema è il seguente: il programmino di ieri per pubblicare su WordPress dal #3DS funziona benissimo, ma mi sono ricordata che dal browser del 3DS non si può caricare come #foto la schermata del gioco in pausa, ma solo cose dall’album… e non tutti i giochi permettono di salvare lì. Per salvare #screenshot da qualunque gioco c’è il menù #Rosalina, ma salva foto non-JPEG e in una cartella diversa. 😪️

Ho pensato per un attimo di forkare #LumaCFW (ho controllato e nessuno lo ha fatto, almeno non per versioni recenti), e modificare la funzione di screenshot per salvare in #JPEG, ma dopo qualche prova mi sa che evito, perché è un casino: l’ambiente di esecuzione è talmente ristretto che non vanno nemmeno tutte le funzioni della #stdlib #C, quindi non è immediato far funzionare tutto. 😮‍💨️

La seconda opzione, più sfavorevole ma comunque decente, sarebbe un #homebrew che converte le foto da #BMP a #JPG e le mette nella cartella giusta… e ovviamente non esiste, esistono cose simili ma non questo, quindi devo farlo io. Ho trovato questa repo da cui posso semplicemente rubare il #codice di #conversione, che sul 3DS compila e quindi dovrebbe tranquillamente fungere. E però mi sto incartando su tutto il resto, cioè la navigazione tra le cartelle e la gestione dei #file (automatica, non pianifico di mettere menù o cose, deve semplicemente aprirsi, convertire, e chiudersi). #Mannaggia! 🤢️

Purtroppo C per fare cose di #utilità pratica (ossia non videogiochini, o roba tipo demo audiovisive, e così via) è #tedioso… soprattutto perché la #API della stdlib fa proprio schifo, con tutti i nomi di funzioni e tipi scritti tutti in minuscolo e spesso senza vocali perché a qualcuno pesava il culo di scrivere parole intere. E quindi finisci per creare millemila macro e funzioni intermedie di astrazioni per evitare di ripetere di continuo le stesse criptiche righe ma così vai a creare astrazioni ancora più astruse per passare i dati in giro e così via. Mi chiedo come sia possibile usarlo per fare addirittura interi sistemi operativi, #pezzi. Vabbè, oggi si soffre. 💀️

https://octospacc.altervista.org/2024/02/10/cazo/

#3DS #API #BMP #C #codice #conversione #file #foto #homebrew #JPEG #JPG #LumaCFW #maledizione #Mannaggia #pezzi #programma #Rosalina #screenshot #stdlib #tedioso

Rick Wong – Tech & coderyguw@fosstodon.org
2023-09-26

2) Python Standard Library: #Python #stdlib comes with batteries included, that means even though there are several ways to do something, in specific cases using a certain stdlib function like `chain()` will be the fastest. Or not, like when cloning a 2d list it's faster to `copy()` manually in a loop than to pickle-unpickle

@doctorwhom

Well done, but ...

>>> import fractions
>>> fractions.Fraction(0.125)
Fraction(1, 8)
>>> fractions.Fraction(0.3333)
Fraction(6004199023210345, 18014398509481984)
>>> fractions.Fraction(0.3333).limit_denominator(1000)
Fraction(1, 3)

A lesser-known part of the #stdlib

😂

Todd A. Jacobs | Rubyisttodd_a_jacobs@ruby.social
2023-06-27

I need a dummy #RubyLang #IMAP server that can support #STARTTLS but otherwise treats most commands as no-ops. I couldn't find anything well-maintained via GitHub or Ruby Toolbox other than the gem from Ruby's #stdlib at:

ruby-doc.org/3.2.2/gems/net-im

Rather than gutting Net::IMAP, is there already a gem out there that can be used to support fetch-before-send clients like Apple's Mail that won't send email before completing POP3 or IMAP4 authentication?

Serge Matveenko ♻️☮️ ⩜⃝lig@fosstodon.org
2022-09-28

Python libs you're using (stdlib and not) that have better alternatives.

- `dataclasses` -> `attrs`
- `json` -> `orjson`
- `requests` -> `httpx`
- `pyoidc` -> `authlib`
- `pytest-freezegun` -> `time-machine`
- `aioredis` -> `redis`

Have I missed anything?

#python #programming #learn #stdlib #libraries #pypi

Serge Matveenko ♻️☮️ ⩜⃝lig@fosstodon.org
2022-09-12

Python stdlib's `pathlib.Path.with_suffix` is
utterly broken.

#python #stdlib #pathlib

conejo 🐇🐰 :clippy:conejo
2022-07-01

« Support for the "embed" package so you can compile static files right into your TinyGo programs.

3/10

 »

— Retweet twitter.com/TinyGolang/status/

2021-02-11

#Cosmopolitan is a universal #C #libc.

Cosmopolitan is an optimized C #stdlib as well as compilation procedure that lets C programs run on #Linux, #Windows, #macOS, #FreeBSD, #OpenBSD, and even bare #BIOS with a single executable file. Cosmopolitan uses the Actually Portable Executable format to accomplish this, allowing for all supported platforms to run the code with no system modification.

Website 🔗️: justine.lol/cosmopolitan/

#free #opensource #foss #fossmendations #programming #development

Stefano Zacchirolizacchiro@mastodon.xyz
2020-10-22

has someone drunkenly hit C-t again?

if name.startswith(('assert', 'assret')):
raise AttributeError("Attributes cannot start with 'assert' or 'assret'")

github.com/python/cpython/blob
#python #stdlib #butwhy

2017-07-04

Does anyone know why on #OpenBSD

l = strtol("0xquux", &rest, 16);

produce
l=0 and rest=0xquux

and on #Linux (at least)
l=0 and rest=xquux

Is there any #C99 gurus who can tell if there is a defined behaviour?

#gcc #llvm #stdlib #clang #programming #unix

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst