10th April 2022
Computer Science⚑
GNULinux⚑
NeoMutt⚑
-
New: Mailboxes commands.
c?<Tab>
: (on top of a mailbox) Shows all subdirectories and allows to open them.
Programming⚑
aiohttp⚑
-
New: Pyhton AIOHTTP.
Basic example:
import aiohttp import asyncio async def main(): async with aiohttp.ClientSession() as session: async with session.get('http://httpbin.org/get') as resp: print(resp.status) print(await resp.text()) asyncio.run(main)
Other methods:
session.put('http://httpbin.org/put', data=b'data') session.delete('http://httpbin.org/delete') session.head('http://httpbin.org/get') session.options('http://httpbin.org/get') session.patch('http://httpbin.org/patch', data=b'data')
-
New: Headers.
headers = { 'Accepts': 'application/json', 'X-API_KEY': 'secret', } async with aiohttp.ClientSession(headers=headers) as session: ...
Basics⚑
-
New: Enum.
Example:
from enum import Enum class Color(Enum): RED = 1 GREEN = 2 BLUE = 3
-
New: Enum examples.
>>> Color(1) <Color.RED: 1> >>> Color(3) <Color.BLUE: 3> >>> Color['RED'] <Color.RED: 1> >>> Color['GREEN'] <Color.GREEN: 2> >>> member = Color.RED >>> member.name 'RED' >>> member.value 1
-
New: Datetime nstance methods.
isoformat()
: ISO 8601 formatted string.
pydantic⚑
-
New: Pydantic types.
pydantic.HttpUrl
pydantic.color.Color
-
New: Exporting.
Options:
model.json(exclude_none=True)
model.dict(exclude_none=True)
Typing⚑
-
New: Awaitable type.
Awaitable
: Promise/Future.