---
title: "Getting to Know Python 3.7: Data Classes, async/await and More!"
description: "Python 3.7 is presented as an upgrade for developers seeking new language features, library improvements, and performance gains over earlier Python 3 releases. The article focuses on data classes, where the @dataclass decorator inspects typed attributes and generates an init method, reducing boilerplate for data-oriented classes. It also covers asyncio.run for simpler asynchronous execution, breakpoint() for entering pdb, module-level getattr for lazy loading, and context variables that keep values separate across execution contexts. Dictionary insertion order becomes part of the language specification in 3.7, while OrderedDict remains available for advanced behavior; reported improvements include 10–30% faster startup, 45–70% faster common sorting cases, 5.5-times-faster dict.copy(), and 4–6-times-faster namedtuple creation."
---

# Getting to Know Python 3.7: Data Classes, async/await and More!

[Heroku](https://yomu.fyi/company/heroku) · Casey · Apr 29, 2019

**Type:** Explainer

## Summary

Python 3.7 is presented as an upgrade for developers seeking new language features, library improvements, and performance gains over earlier Python 3 releases. The article focuses on data classes, where the @dataclass decorator inspects typed attributes and generates an init method, reducing boilerplate for data-oriented classes. It also covers asyncio.run for simpler asynchronous execution, breakpoint() for entering pdb, module-level getattr for lazy loading, and context variables that keep values separate across execution contexts. Dictionary insertion order becomes part of the language specification in 3.7, while OrderedDict remains available for advanced behavior; reported improvements include 10–30% faster startup, 45–70% faster common sorting cases, 5.5-times-faster dict.copy(), and 4–6-times-faster namedtuple creation.

## Context

Earlier Python versions required substantial boilerplate for classes representing application data, and asynchronous code using thread-local context could allow values to bleed across executions. The article also frames Python 3.7 as an upgrade containing language, asyncio, debugging, module-loading, dictionary, and performance improvements.

## Approach / What changed

Python 3.7 adds the @dataclass decorator, asyncio.run(), breakpoint(), module-level getattr(), context variables, and language-level dictionary ordering. The article demonstrates these features with Python examples and lists reported performance improvements for startup, typing, sorting, dict.copy(), and namedtuple creation.

## Takeaways

- @dataclass generates an init method from typed class attributes, reducing boilerplate for data-oriented classes while still allowing class methods.
- asyncio.run() replaces the earlier get\_event\_loop(), run\_until\_complete(), and close() sequence for running an asynchronous task; context variables provide values that differ across execution contexts.
- Python 3.7 makes dictionary insertion order part of the language specification, while OrderedDict remains available for advanced operations and different equality comparisons.

**Tags:** [asyncio](https://yomu.fyi/topic/asyncio), [Debugging](https://yomu.fyi/topic/debugging), [Python](https://yomu.fyi/topic/python)

- Source: [Heroku](https://www.heroku.com/blog/python37-dataclasses-async-await)
- Source URL: https://www.heroku.com/blog/python37-dataclasses-async-await
- Ingested by Yomu: 2026-09-09T14:27:28.857Z

[Read original post](https://www.heroku.com/blog/python37-dataclasses-async-await)
