EuroPython 2016

The Stupid Python Workshop

Speaker(s) Mark Smith

Spend time using and abusing advanced features of Python, for fun, with little consideration of what is a good or bad idea.

Developers avoid using advanced language features because they don’t want to write code that is difficult to understand. Don’t be one of those developers! Come on an adventure to push Python syntax to its limits.

This workshop is aimed at intermediate Python developers. Attendees should be comfortable with Python’s syntax and should be intrigued or confused by: magic methods; how @property works; and what on Earth a metaclass is. Attendees will learn how these things work, starting with the more straightforward features. I’ll introduce each concept assuming the attendees have never used them before.

We’ll be writing silly and bad things. We aim to understand how they work, not whether they are a good idea, but in each case there will be a brief discussion of what each feature was really designed for. The exact contents are not confirmed, but should include some or all of the following:

  • Override operators for more flexible syntax.
  • Using __new__ for fun and profit.
  • Functions that behave differently depending on the values in the caller’s scope.
  • Tacking extra methods on to classes we don’t own.
  • Abuse of the descriptor protocol.
  • Messing with imports.
  • Decorators that do things decorators were never meant to do.
  • Write a metaclass and see if the world ends.

in on Thursday 21 July at 10:15 See schedule

Comments

  1. Gravatar
    Can you share a timeline, training contents and a draft of the slides?

    Thx+Peace,
    R.
    — Roberto Polli,
  2. Gravatar
    Not at this time, Roberto, sorry. It will be an entirely new workshop, although I am an experienced trainer.

    I think the long abstract goes into quite a lot of detail for the planned contents.
    — Mark Smith,
  3. Gravatar
    The contents are fine.

    The timing helps understand how the contents fits in the timeslot and understand eg in an hourly fashion the actual delivery.

    Can you link to some other training you made?

    Thx++,
    R:
    — Roberto Polli,
  4. Gravatar
    The problem with timing for interactive sessions, like training is that they're driven by the trainees. I'll be running the training session twice before Europython, and so will have a chance to adjust the content based on feedback.

    Feel free to watch my Europython talk from 2014, but I don't have training videos because of the interactive nature of a training session.
    — Mark Smith,

New comment