Time | Talk |
---|---|
10:45 | How we are making CPython faster. — Forum Hall |
11:35 | How we are supercharging f-strings in Python 3.12 — Forum Hall |
12:10 | |
14:00 | CPython Core Developer Panel — Forum Hall |
15:30 | Dynamically generated methods with a non-generic signature — Forum Hall |
16:05 | DuckDB: Bringing analytical SQL directly to your Python shell — Terrace 2B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Cloudflare Pages middleware function for enforcing HTTP Basic authentication. | |
* | |
* Usage: | |
* 1. Add this file to the `functions` directory in your Pages repository. | |
* 2. Enable Node.js for your Pages functions through the dashboard: | |
* https://developers.cloudflare.com/workers/runtime-apis/nodejs/#enable-nodejs-from-the-cloudflare-dashboard | |
* 3. Set the following environment variables: | |
* - HTTP_BASIC_AUTH_USERNAME for the expected username. | |
* - HTTP_BASIC_AUTH_PASSWORD for the expected password. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow saving of tunnel passwords | |
ALLOW_SAVE_TUNNEL_PASSWORD = True |
Time | Talk |
---|---|
10:45 | Making Python better one error message at a time — The Auditorium |
11:35 | Booth shift |
12:10 | CPython bugs & risky features — The Auditorium |
14:00 | Protocols in Python: Why You Need Them — Liffy B |
14:35 | Dance with shadows: stubs, patch and mock — Liffey Hall 2 |
15:30 | Booth shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from json.decoder import JSONDecodeError | |
from urllib.parse import urljoin | |
import requests | |
class DiscogsAPIClientAuth(requests.auth.AuthBase): | |
""" | |
Authentication class used for authenticating requests using required | |
Discogs API access token. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
re.compile( | |
# Pattern | |
r'^' | |
r'(?:https?:\/\/)' # scheme | |
r'(?:(?!-)[a-z' + '\u00a1-\uffff' + r'0-9-]{1,63}(?<!-)\.)+' # domain | |
r'(?:(?!-)(?:[a-z' + '\u00a1-\uffff' + r'-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\.?)' # TLD | |
r'(?:[/?#][^\s]*)?' # path, query & fragment | |
r'$', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new RegExp( | |
// Pattern | |
"^" + | |
"(?:https?:\\/\\/)" + // scheme | |
"(?:(?!-)[a-z\\u00a1-\\uffff0-9-]{1,63}(?<!-)\\.)+" + // domain | |
"(?:(?!-)(?:[a-z\\u00a1-\\uffff-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?)" + // TLD | |
"(?:[/?#][^\\s]*)?" + // path, query & fragment | |
"$", | |
// Flags | |
"i" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ignore case when globbing files | |
shopt -s nocaseglob | |
# Convert all HEIC files found in the current directory | |
for file in $(compgen -G "*.heic"); do | |
echo "Converting HEIC file ${file}..." | |
# Remove extension using parameter expansion | |
# (see: https://stackoverflow.com/a/12152997) |