RUVIDEO
Поделитесь видео 🙏

Immutable vs Mutable Objects in Python смотреть онлайн

https://dbader.org/python-tricks ► Improve your Python skills, one bite at a time and write Pythonic and beautiful code.

In Python, immutable vs mutable data types and objects types can cause some confusion—and weird bugs. With this video you'll see what the difference between mutable and immutable data types is in Python, and how you can use it to your advantage in your own programs.

You'll also see how to deal with a language quirk in Python that allows objects referenced by immutable types to me modified. Python's definition of "immutable" can be a bit misleading:

Basically, the promise of "immutability" on tuples is only partly true. The tuple itself cannot be modified, but objects referenced by the tuple can be. This is sometimes called "non-transitive immutability."

If the tuple has an immutable field like a string for example, then it cannot be modified. A mutable field like a list however, can be edited, even if it's embedded in the "immutable" tuple.

When the Python documentation refers to an object as being "immutable" they mean the behavior above observed. Other immutable types in Python behave the same way, e.g. namedtuples or frozensets.

If you've ever encountered the following exception and now you want to know why, this is the video for you:

TypeError: 'tuple' object does not support item assignment

* * *

► Python MUGS, T-SHIRTS & MORE: https://nerdlettering.com

FREE Python Tutorials & News:
» Python Tutorials: https://dbader.org
» Python News on Twitter: https://twitter.com/@dbader_org
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Immutable vs Mutable Objects in Python» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.