DjangoCon US 2018 - Easier Classes: Python Classes Without All The Cruft by Trey Hunner

Channel:
Subscribers:
42,400
Published on ● Video Link: https://www.youtube.com/watch?v=htFMzu7ITpg



Duration: 0:00
30 views
0


DjangoCon US 2018 - Easier Classes: Python Classes Without All The Cruft by Trey Hunner

When bundling up data, sometimes tuples and dictionaries don’t quite cut it. Python’s classes are powerful tools for data storage and manipulation, but it can take quite a bit of boilerplate code to make a well-behaved Python class. In this talk we’re going to discuss how a well-behaved class should work and take a look at a number of helper libraries for creating well-behaved classes.

We’ll first see how to make classes with proper string representations, comparability, iterability, and immutability. Then we’ll dive into helper tools built-in to the standard library and available in third-party libraries and briefly discuss which of these tools makes sense to use with Django’s classes.

We’ll look at namedtuple, NamedTuple (not a typo), attrs, and the new Python 3.7 dataclasses.

Most of the libraries discussed in this talk are only available in Python 3, so if you’re not using Python 3, hopefully this talk will encourage you to upgrade.




Other Videos By Confreaks


2022-04-08DjangoCon US 2018 - How to give a damn, and stand out by Amber Wanner
2022-04-08DjangoCon US 2018 - Unique ways to Hack into a Python Web Service by Tilak T
2022-04-08DjangoCon US 2018 - Pseu, Pseu, Pseudio. Pseudonymization in Django. by Frank Valcarcel
2022-04-08DjangoCon US 2018 - Anatomy of Open edX - a modern online learning platforms... by Nate Aune
2022-04-08DjangoCon US 2018 - "State of Django" Panel by Simon Willison
2022-04-08DjangoCon US 2018 - The Power of GeoDjango by Anna Kiefer
2022-04-08DjangoCon US 2018 - Data internationalization in Django by Raphael Michel
2022-04-08DjangoCon US 2018 - ORM: The Sequel by Katie McLaughlin
2022-04-08DjangoCon US 2018 - Strategies for Zero Down Time, Frequent Deployments by Nick Humrich
2022-04-08DjangoCon US 2018 - Lightning Talks Day 3
2022-04-08DjangoCon US 2018 - Easier Classes: Python Classes Without All The Cruft by Trey Hunner
2022-04-08DjangoCon US 2018 - Django REST Framework: Moving Past the Tutorial to Production by Drew Winstel
2022-04-08DjangoCon US 2018 - Keynote with Mariatta Wijaya
2022-04-08DjangoCon US 2018 - Building a Community for All People by Jennifer Konikowski
2022-04-08DjangoCon US 2018 - We Are 3000 Years Behind... by Hayley Denbraver
2022-04-08DjangoCon US 2018 - Python on your phone: Building mobile apps with Kivy by Derek Payton
2022-04-08DjangoCon US 2018 - One Engineer, an API, and an MVP... by Nicole Zuckerman
2022-04-08DjangoCon US 2018 - When your wetware has too many threads... by Aaron Bassett
2022-04-08DjangoCon US 2018 - Here Come The Robots - Django and Machine Learning by Tom Dyson
2022-04-08DjangoCon US 2018 - Finally Understand Authentication in Django REST Framework by William S. Vincent
2022-04-08DjangoCon US 2018 - What's in a Name? Your Guide to the Wacky World of DNS by Ashley Sullins