I was hoping for iter and callable to be part of the ride, as this is going to lead people to use list/tuple instead of typing.Iterable since it's easier to type.

But it's a nice improvement.

Now if PEP 604 is added into the mix, 3.9 will start to look seriously sexy

Afficher le fil de discussion

PEP 585 has been merged into 3.9 github.com/python/cpython/pull

This is a huge step toward making type hints accessible as it allows to do:

dict[tuple[int, int], list[str]]

Instead of:

from typing import Dict, List, Tuple
Dict[Tuple[int, int], List[str]]

Bootstrap Icons

For the first time ever, Bootstrap has its own icon library, custom designed and built for our components and documentation. "

PyTorch Implementation of "Lossless Image Compression through Super-Resolution" github.com/caoscott/SReC

On of the reason I'm still using pew is because it let you create a venv without a project, yet associate a project dir with a venv later with auto cd.

It's possible dephell will implement this at some point. Finger crosses.

RT @martinRenou@twitter.com

Tired of typing those two lines:

cd github/project
conda activate project

I added an activate function to my .bashrc

activate project

🐦🔗: twitter.com/martinRenou/status

RT @pooldad@twitter.com

if you pixelate the picture of justin beibers house a bit it looks like it's from a 1999 strategy game

🐦🔗: twitter.com/pooldad/status/124

RT @tamouse@twitter.com

hey, frenz, i heard today that i'm going to laid off.

i go deep in the intersection of Rails+React+GraphQL. i have ❤️ for Python, Vue.js, plain old Ruby and JavaScript, and a raft of others.

i'd appreciate good thoughts, RTs, etc.


🐦🔗: twitter.com/tamouse/status/124

RT @getajobmike@twitter.com

A Rails/Py/PHP monolith remains the best unit of deployment for 90% of businesses. twitter.com/GergelyOrosz/statu

🐦🔗: twitter.com/getajobmike/status

So pexpect is way more confortable, but you don't always want another dependancy.

asyncio.subprocess works on Unix and Windows, but
is available for Windows only if a ProactorEventLoop is used (it's now the default in python 3.8)

Afficher le fil de discussion

It has a few gotchas though:

- failing to pass a byte count to proc.stdout.read() will likely block forever
- proc.stdin.write() accepts only bytes, no str
- last print needs flush=True or you'll get a warning
- you have to process it all manually

Afficher le fil de discussion

print(await proc.stdout.read(64))
print(await proc.stdout.read(64))
print(await proc.stdout.read(64), flush=True)

And that's it, I started the process and answered the questions!

Afficher le fil de discussion

Inside my main() function, I can start the subprocess:

proc = await aio.create_subprocess_exec(
"sh", "test.sh", stdin=PIPE, stdout=PIPE,

And then communicate with it:

Afficher le fil de discussion

import asyncio as aio

PIPE = aio.subprocess.PIPE

async def main():


Afficher le fil de discussion

echo -n "Foo: "
read foo
echo -n "Bar: "
read bar
echo "You chose $foo and $bar"

I want to pilot it to do:

Foo: a
Bar: b
You chose a and b

Then I can do:

Afficher le fil de discussion

Using the "asyncio.subprocess" module, you can communicate back and forth with subprocesses, unlike the subprocess module which is a one time blocking deal. No need for pexpect!

It's very handy for tests and automation.

Let's say I have this bash script:


Le réseau social de l'avenir : Pas d'annonces, pas de surveillance institutionnelle, conception éthique et décentralisation ! Possédez vos données avec Mastodon !