Creating one list out of another list is a very common thing to do in Python, so common that Python includes a special construct just for this purpose: list comprehensions.
In this tutorial, we’ll get hands-on experience using list comprehensions, set comprehensions, and dictionary comprehensions. We’ll also learn how and when we can slightly tweak our comprehensions to turn them into more performant generator expressions.
We will learn some tricks for figuring out which of our “for” loops can be rewritten as comprehensions and which cannot. We will focus heavily on code readability and code clarity and we’ll discuss when comprehensions help readability and when they hurt.
All new skills will be acquired through practice. We’ll work through many exercises both individually and as a group. All students will also receive a cheat sheet which can be used for guidance during future comprehension-writing journeys.
A laptop with Python installed is required for this workshop.
This tutorial is for Python programmers who are familiar with looping in Python but haven’t fully embraced list comprehensions and generator expressions. Students are expected to be comfortable with Python’s syntax overall and be familiar with for loops in Python.
Students will walk out of this tutorial with an appreciation for what list comprehensions are good for and how to use them to write more descriptive and more readable Python code. Students will also have an understanding that generator expressions can be used to ease data processing, allowing code to be written in a fundamentally different (and often more clear) way.
List Comprehensions (30 minutes)
More List Comprehensions (30 minutes)
Set & Dictionary Comprehensions (30 minutes)
Generator Expressions (45 minutes)
Data Processing (45 minutes)
I plan to provide quite a bit of exercise time during this tutorial. I will provide more than enough exercises for the allotted time so that students will not walk out of the room bored by the material.
I work as a professional Python trainer and I have hosted workshops for companies, conferences, and local meetups. My workshops are typically very hands-on and exercise driven.
I have taught this workshop-style tutorial before at PyCon 2018 as well as through my Python training company, Truthful Technology LLC.
Trey is a seasoned instructor and proposer, and has included all the required material.
The description is excellent, giving us and prospective attendees a clear idea of what they will learn, what the tutorial will emphasize, what materials will be provided, and how the tutorial will be taught.
Clear description and learning goals. This doesn’t just say advanced/intermediate/beginner; it shows, in detail, exactly what the attendees are expected to know (and to not know)
Trey shows when he will cover exercises and when he will lecture. We love to see this. Trey also shows thoughtfulness regarding having enough exercises.
One reviewer was happy to see this material applied to data processing.
One reviewer expressed concern regarding number of topics Trey planned to cover, and its ability to fill the timeslot, but Trey’s past teaching experience gave us confidence he had weighed things carefully.
Overall, this is an excellent outline satisfies all our requirements. However, if you don’t have as much experience writing proposals as Trey and are worried about giving enough detail, we recommend erring on the side of ‘too long’ rather than ‘too short’.
Note your timing notes don’t have to be this precise. Rounding to 30 minute increments or marking all of the sections at 20% would have also been just fine.
Note also that we now request that submitters denote what portion of the tutorial will be dedicated to participation versus lecturing. This was not the case when this tutorial was submitted.
What else Trey could have done:
Describe time tradeoffs: What sections/topics might run long? Which sections might he shorten if this happens?
This tutorial is an introduction to writing about Python: we’ll cover potential pitfalls in documentation and other technical writing, practice writing non-technical content (from blog posts to job listings), and testing our writing for readability and accessibility. We’ll even cover where writing can fit into your workflow and a few tricks for reducing your writing workload.
After this tutorial, you’ll be equipped to write about Python for both technical and nontechnical audiences. You might even enjoy writing by the time we’re done!
While this tutorial is aimed at programmers with Python experience, non-technical attendees will find the material accessible. Some basic knowledge about the Python programming language and the Python community is required (making it to PyCon in the first place demonstrates the level of knowledge required).
Attendees will have at least one writing sample they can share and will be better equipped to write and test their own materials, as well as evaluate others’ writing. They’ll also know about opportunities to share their writing with other pythonistas.
Introduction (15 min) * Why good writing matters * Accessibility * Usability Reading Activity (15 min) * Review examples of Python writing * Discuss errors and possible fixes Documentation Activity (45 min) * Write 5-step tutorial solo * Edit and discuss as a group Templates and Other Shortcuts (30 min) * Overview of shortcut opportunities * Templates vs templating (disambiguation) Job Listing Activity (30 min) * Review template * Fill in template solo * Edit and discuss as a group Writing for Other People (30 min) * Planning writing projects * Guest posts pitches, book proposals, and what they have in common) * Writing opportunities in the Python community Wrapup (15 min) * Practice writing * Writing resources * Final questions
While this tutorial draws on The Python Style Supplement, attendees do not need a copy. I’ll have a workbook that each attendee will be able to take home (which I’ll need help printing in Cleveland).
You can see an ARC of The Python Style Supplement here: REDACTED
This is a tutorial on a less commonly covered topic and in an unconventional format. Because it was relatively unique, it wasn’t competing directly with others in the same category. However, its unconventional format generated both concern and enthusiasm. Two reviewers suggested that it might be better presented as a talk. However, the majority of reviewers were excited by the tutorial and were won over by the quality of the proposal.
We especially liked the ‘audience’ section. The description of whom the tutorial was aimed at was excellent.
Most of our favorite proposals include clear learning goals (showing us what the audience will learn, and giving them motivation to attend). This one provides additional details, unique to the format of the tutorial itself:
“Attendees will have at least one writing sample they can share and will be better equipped to write and test their own materials, as well as evaluate others’ writing. They’ll also know about opportunities to share their writing with other pythonistas.”
We appreciated having access to some materials ahead of time (the author’s book-in-progress). Her requirement that we print the documents didn’t cause concern; we appreciated her forethought.
We all know we should be testing our applications, but testing is hard and great testing is even harder. Take a deep dive into what and how to test your Django apps, plus learn how to leverage modern headless browser libraries and automated visual diff-ing to get (and keep) pixel-perfect apps.
Preliminary talk materials (currently incomplete):
Preliminary talk slides (currently incomplete):
Scheduling: I would need to be scheduled on the second tutorial day, as I’ll be attending the Language Summit on the first day.
Reviewers really liked the topic, noting that it was popular and important, yet not frequently proposed.
Materials and Past Experience:
While not visible here, Emily included some preliminary slides and materials, which we found to be quite detailed. We appreciated her inclusion of videos of her prior talks.
Emily’s outline provides a lot of detail. Note that instead of single words, she includes long phrases and complete sentences, giving us an idea of not just what points she’ll be discussing, but how she’ll be covering them.
Note that her timings differ from this year’s guidelines.