Tutorial Samples

Sample 1: Using List Comprehensions and Generator Expressions For Data Processing, by Trey Hunner

Description

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.

Audience

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.

Outline

  • List Comprehensions (30 minutes)
    • Review of for loops in Python
    • List comprehensions for transformation
    • Copy-pasting from a loop to a comprehension
    • First exercise break
  • More List Comprehensions (30 minutes)
    • Comprehensions with filtering
    • Identifying comprehension-ready loops
    • Writing readable comprehensions
    • Second exercise break
    • When to use list comprehensions and when not to use them
  • Set & Dictionary Comprehensions (30 minutes)
    • Sets & Set Comprehensions
    • Dictionaries & Dictionary Comprehensions
    • Third exercise break
  • Generator Expressions (45 minutes)
    • Python’s many functions that consume iterables
    • Generator expressions as lazy list comprehensions
    • Properties of lazy single-use iterables
    • Fourth exercise break
  • Data Processing (45 minutes)
    • Generator piping for data processing
    • Generators combined with tuple, any, all, etc
    • Fifth exercise break
    • Cheat sheet and review of when and how we use these tools

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.

Additional Notes

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.

Sample 1: Evaluation

Trey is a seasoned instructor and proposer, and has included all the required material.

Description:


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.

Audience:


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)

Outline:

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.

Format:

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?

Sample 2: Writing about Python (Even When You Hate Writing), by Thursday Bram

Description

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!

Audience

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.

Outline

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

Additional Notes

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

Sample 2: Evaluation

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.

Audience:

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.”

Additional Notes:

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.

Sample 3: What To Expect When You’re Expecting: A Hands-On Guide to Regression Testing (Emily Morehouse)

Description

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.

Audience

A foundational knowledge of Python and a web framework of choice is beneficial, as we’ll dive right into testing an existing application. Starter code and code progressions will be provided, so you don’t have to be a Django expert to grasp the content! Whether you love, hate, or have never used Javascript, you’ll feel at home; our use of JS will be limited to leveraging libraries to gather data and screenshots for visual regression testing, whether for a JS client or a Django web app.

Outline

  • Introduction (10 mins, 10 mins total)
    • Introduction, outline, and expectations of what you should take away from this tutorial
  • Foundational Knowledge for Testing (35 mins, 45 mins total)
    • Testing, Wat?
      • We all know we should be writing tests for our code, but what does that really mean?
      • What does writing tests “in the real world” look like?
    • Rapid-Fire Introduction to Testing: 20,000 foot view, short descriptions of different types of testing
      • What kinds of tests are most impactful for different use cases?
    • The Importance Of Consistent Regression Testing
      • Change blindness
    • Anatomy Of A Test
      • Ingredients for successful testing
      • Process and workflows for testing
    • What Should You Be Testing?
      • Good tests mimic good bug reports
    • Approaches For Regression Testing
    • Approaches For Visual Regression Testing
      • Visual Regression Testing Is Easier In 2018!
  • Walkthrough - Regression Testing in Django (1 hr, 1.75 hr total)
    • From a carefully crafted starter application, we’ll walk through the important aspects of our application that must, could and should be tested. We’ll also cover tips for scoping out areas that are more likely to have bugs introduced and ways to separate your code appropriately for the best testing approaches.
  • Walkthrough - Visual Regression Testing Powered By Javascript (45 mins, 2.5 hrs total)
    • From our same carefully crafter starter app, we’ll add visual regression tests using my test runner, test assertion, web driver, and image diff libraries of choice. (Yes, you CAN use Python for this, but there are some awesome JS libraries that make our lives even easier).
  • Flex Time (remainder of time left)
    • Additional time for breaking things and putting them back together, questions, helping each other, etc.
  • Conclusion
    • Wrap up, call to action, and suggested tools/resources

Additional Notes

Preliminary talk materials (currently incomplete):
- REDACTED
Preliminary talk slides (currently incomplete):
- REDACTED

Previous talks: [insert video]

Scheduling: I would need to be scheduled on the second tutorial day, as I’ll be attending the Language Summit on the first day.

Sample 3: Evaluation

Topic:


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.

Outline:

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.