Mariatta 🤦 Profile picture
Apr 30 11 tweets 6 min read
#PyConUS2022 @jessejiryudavis Why should async get all the love?
Advanced control flow with thread.

Asyncio is really hip. Also twisted, tornado, curio and trio. They're all super cool.
#PyConUS2022 @jessejiryudavis In all these excitements, there was a message that was lost.
All of this was already with threads.
#PyConUS2022 @jessejiryudavis
When should you use threads or asyncio?
These are two ways to do concurrency.
Neither threads nor asyncio can use multiple CPUs
#PyConUS2022 @jessejiryudavis If you really need parallelism, use multi-processing.
#PyConUS2022 @jessejiryudavis
Concurrency is dealing with events in particular order.
e.q. waiting for data on many network connections at once.
#PyConUS2022 @jessejiryudavis
Is asyncio faster than threads?
Sadly no.
read calpaterson.com/async-python-i…
It is more efficient only for huge numbers of most idle connections.
#PyConUS2022 @jessejiryudavis Asyncio is not compatible with most popular Python web frameworks.
If you want to use asyncio, you'll probably have to spend effort to rewrite your code into the compatible framework.
#PyConUS2022 @jessejiryudavis Disagrees with @glyph that "Threads are bad".
Glyph's point was that we should use asyncio not because it was faster, but because it was less tricky.
#PyConUS2022 @jessejiryudavis
Threads: Speed
Compatibility: already compatible with popular Python web frameworks

Asyncio: more memory efficient, but less tricky.
But it doesn't have to be this way.
#PyConUS2022 @jessejiryudavis is now showing how to write less tricky code with threads and giving sample codes using concurrent.futures (available since Python 3.2) and Executors
Go read the slides and watch the recording!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Mariatta 🤦

Mariatta 🤦 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @mariatta

May 2
My first visit to a real @Google office since joining!
Visited @googlefiber in Salt Lake City! Thanks Bill Yoshimi for taking me along for a tour! Now I feel like a real Googler 😄 Image
The office just opened in January, and it looks very cozy!
There's a room with a message chair so yes I made use of it 💆‍♀️ ImageImageImage
Cute Google Bike 🚲 Image
Read 4 tweets
May 1
#PyConUS2022 Python SC (Steering Council) panel.
We have @pyblogsal and @Yhg1s from the SC joining us today.
Agenda:
- What is the SC?
- Highlights of the year?
- What's new in Python 3.11
- pre-recorded Q&A
#PyConUS2022 Python SC Agenda:
SC is defined in PEP 13: in charge of the python programming language, and CPython implementation
Govern by consensus. Fosters the community and the core devs.
Final decision on PEPs (Python Enhancement Proposals), except those delegated.
#PyConUS2022 Python SC
The SC meets weekly. SC is separate from PSF but have very good working relationship.
Monthly updates published in
github.com/python/steerin…
Write to them at steering-council at python dot org
Read 25 tweets
May 1
#PyConUS2022 D&I WG Panel with @georgically1 @loooorenanicole @anthonypjshaw and @reuvenmlerner
They will tell us what PSF Diversity and Inclusion Work Group is all about. Image
#PyConUS2022 D&I WG Panel:
is a group of 20 members led by @marlene_zw , founded in 2020.
It was created, there were 4 open seats for PSF Board of Directors.
26 nominees, from all over the world.
1151 PSF members, only 40% voted.
Yet all 4 four elected were North Americans.
#PyConUS2022 D&I WG Panel:
In 2021 We elected more people outside of North America, yet none from Asia despite there were 9 nominations.
Read 18 tweets
Apr 30
#PyConUS2022 @masonegger on Write Docs Devs Love. Ten Tricks to Level Up Your Tech Writing

Follow along and get the slides by scanning the barcode: Image
#PyConUS2022 @masonegger
What is tech writing?
TFW when you follow an online tutorial or docs and the code works on the first run.
Then think of the hours spent wasted following outdated docs.
The difference is Tech writing.
Read 17 tweets
Apr 30
Currently attending #PyConUS2022 @pyblogsal on Making Python better one error message at a time.
(Not sure i'll be able to live-tweet but will try. Pablo speaks very fast!)
#PyConUS2022 @pyblogsal Syntax errors are important. They impact developer time.

Pablo shows several examples of SyntaxErrors prior to Python 3.9 that weren't helpful. The error simply says "invalid syntax", when the real problems are things like not closing "}" or ")" Image
#PyConUS2022 @pyblogsal The new PEG parser (from PEP 617) replaces the parsing in CPython, co-authored by @pyblogsal @lysnikolaou @gvanrossum
The original parser was written in 1990.
Read 6 tweets
Apr 30
#PyConUS2022 @pwang Keynote: Announcing Py-script!!!
It's Python! inside HTML!!! 🤯 Image
@pwang #PyConUS2022 @pwang Keynote

And asyncio! And blink tag! 🤯
No webserver needed! It's HTML!
It's actual CPython compiler into WASM. Image
@pwang #PyConUS2022 @pwang Keynote
And now we all got rickrolled! 😆🙃
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(