Kyle Knapp - Dynamic Class Generation in Python
Kyle Knapp - Dynamic Class Generation in Python
[EuroPython 2016]
[18 July 2016]
[Bilbao, Euskadi, Spain]
(https://ep2016.europython.eu//conference/talks/dynamic-class-generation-in-python)
This talk is about dynamic class generation in python: the practice of
writing code that generates classes and their functionality at
runtime. It will use boto3, the AWS SDK for Python, as a basis to dive
into the basics, the benefits, and the drawbacks to dynamically
generating classes.
-----
This talk is about the concept of dynamic class generation in python.
The whole idea is writing code that generates classes and their
functionality at runtime. You now may be asking yourself, “That sounds
like a neat trick. Why would I ever generate my classes at runtime?”
Here are a few reasons why:
- It can decrease the physical size of your code.
- It can improve the workflow in adding new functionality.
- It can improve reliability of your code.
One example where the power of this concept has really been leveraged
is in boto3, the AWS SDK for Python. Dynamic class generation has
allowed boto3 to become heavily data driven such that most of its
classes and methods are generated based off JSON models representing
aspects of an AWS service’s API. For example, to add support for a new
AWS service API in boto3, just plop in a JSON file into the library
with no additional Python code required.
Using lessons and techniques drawn from developing boto3, this talk
will dive into the following topics related to dynamic class
generation:
- The basics of dynamic class generation such as how to effectively
dynamically generate classes.
- How to overcome some of the challenges of dynamic class generation.
- The tradeoffs in dynamically generating classes and discussion on
when it is appropriate.
By the end of this talk, the hope is that you will have a better
understanding of dynamic class generation and come away with helpful
ideas for your next big project.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Kyle Knapp - Dynamic Class Generation in Python», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.