Python's collections.abc | InvertibleDict

  Рет қаралды 44,480

mCoding

mCoding

Күн бұрын

Learn your ABCs!
That's Abstract Base Classes, by the way. Python provides a standard set of interfaces for abstract collections that are widely used. They come in the collections.abc module and can be used for type hinting purposes, runtime interface checking, as well as being usable as base classes to define many interface functions based on just a few. For instance, if you define _getitem__, __iter_ and _len__, then Python can automatically define the rest of the Mapping interface functions __contains__, keys, items, values, get, __eq__, and __ne_ by using the ones you provided. We demonstrate abstract collections by implementing an invertible dictionary class that is a MutableMapping.
CONTEST CURRENTLY CLOSED! Thanks for playing!
OFFICIAL CONTEST RULES:
1. All entries must comply with the KZbin community guidelines ( kzbin.infocommunity_gu...) and KZbin Terms of Service (kzbin.info?gl=US&t.... Entries that violate KZbin guidelines are automatically disqualified.
2. KZbin is not a sponsor of the contest and viewers are required to release KZbin from any liability related to the contest.
3. Privacy notice: no personal data will be collected for this contest.
4. In order to enter, you must (a) be one of my subscribers, AND (b) make a top-level comment to the video including #pycharm somewhere in the comment.
5. The contest is free, there is no fee required to enter.
6. Winners will be chosen randomly 1 week after the date the video went live from all users who have entered and not been disqualified.
7. Each winner will be notified via a comment reply from me that details what prize was won (e.g. "Congratulations! You have won XYZ. Please email me."). I will ask the winner to contact me by email, and I will reply through email with a random token which must be posted as another reply to the winning comment from the winning account in order to verify account ownership and prevent fraud.
8. Each winner will have 72 hours to respond AND prove account ownership or their prize is automatically forfeited and another winner will be chosen.
9. A winner can only win 1 prize per contest.
10. The prize pool for this contest is: 2 licenses ("Free 1-Year Personal Subscription") to any of these JetBrains IDEs: AppCode, CLion, DataGrip, DataSpell, GoLand, IntelliJ IDEA Ultimate, PhpStorm, PyCharm, ReSharper, ReSharper C++, Rider, RubyMine, WebStorm, or dotUltimate. A prize consists of 1 license, which will be delivered in the form of a redeemable code that can be redeemed at www.jetbrains.com/store/redeem/ before July 17, 2023.
11. You may not enter the contest if doing so would be a violation of any relevant federal, state, and local laws, rules, and regulations, including U.S. sanctions.
― mCoding with James Murphy (mcoding.io)
Source code: github.com/mCodingLLC/VideosS...
collections.abc docs: docs.python.org/3/library/col...
slots video: • Python __slots__ and o...
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
/ mcoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
www.paypal.com/donate/?hosted...
Want to donate crypto? Check out the rest of my supported donations on my website!
mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: / discord
Github: github.com/mCodingLLC/
Reddit: / mcoding
Facebook: / james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:35 All the ABCs
2:28 Type hinting
4:03 Runtime Interface Checking
5:38 InvertibleDict
13:44 Outro

Пікірлер: 169
super/MRO, Python's most misunderstood feature.
21:07
mCoding
Рет қаралды 212 М.
Protocol Or ABC In Python - When to Use Which One?
23:45
ArjanCodes
Рет қаралды 197 М.
2000000❤️⚽️#shorts #thankyou
00:20
あしざるFC
Рет қаралды 15 МЛН
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 6 МЛН
⬅️🤔➡️
00:31
Celine Dept
Рет қаралды 32 МЛН
Metaclasses in Python
15:45
mCoding
Рет қаралды 149 М.
Kafka Stream Processing with Python - A Walkthrough
15:06
Modern Python logging
21:32
mCoding
Рет қаралды 152 М.
Object Oriented Programming is Good | Prime Reacts
31:30
ThePrimeTime
Рет қаралды 285 М.
Every Python dev falls for this (name mangling)
14:11
mCoding
Рет қаралды 136 М.
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 52 М.
Python 3.12 Generic Types Explained
18:27
ArjanCodes
Рет қаралды 57 М.
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 85 М.
i love you subscriber ♥️ #iphone #iphonefold #shortvideo
0:14
Si pamerR
Рет қаралды 3,1 МЛН
Apple watch hidden camera
0:34
_vector_
Рет қаралды 62 МЛН
Mem VPN - в Apple Store
0:30
AndroHack
Рет қаралды 104 М.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 13 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 6 МЛН