Method Chaining Classes in Python
Method chaining, cascading, or the "Fluent API".
This style of programming involves having methods of a class return the object they operate on in order to allow a subsequent method call. This is used to chain mutations of an instance or can also be used creating copies for immutable objects. This is not the most common style of programming, but it does have some niche uses, which we explore in this video.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
SQLAlchemy: https://docs.sqlalchemy.org/en/14/orm/quickstart.html
pyjanitor: https://pyjanitor-devs.github.io/pyjanitor/
SUPPORT ME ⭐
---------------------------------------------------
Patreon: https://patreon.com/mCoding
Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Other donations: https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, John Martin, Casey G
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:12 Basic example
1:20 Immutable examples
2:21 SQLAlchemy select
3:18 Pyjanitor example
Видео Method Chaining Classes in Python канала mCoding
This style of programming involves having methods of a class return the object they operate on in order to allow a subsequent method call. This is used to chain mutations of an instance or can also be used creating copies for immutable objects. This is not the most common style of programming, but it does have some niche uses, which we explore in this video.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
SQLAlchemy: https://docs.sqlalchemy.org/en/14/orm/quickstart.html
pyjanitor: https://pyjanitor-devs.github.io/pyjanitor/
SUPPORT ME ⭐
---------------------------------------------------
Patreon: https://patreon.com/mCoding
Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Other donations: https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, John Martin, Casey G
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:12 Basic example
1:20 Immutable examples
2:21 SQLAlchemy select
3:18 Pyjanitor example
Видео Method Chaining Classes in Python канала mCoding
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Match statement tipsReturn Value Optimization and Copy Elision in C++Python Iterators! COPY or NO COPY?Using except: is a HUGE mistakeAsynchronous Web Apps in PythonIntroducing mZips! Python Zip and Zip LongestThe ins and outs of context managers and try-finally in Pythonstr vs bytes in PythonPositional-only and keyword-only arguments in PythonAutomated Testing in Python with pytest, tox, and GitHub ActionsAsync application classes vs. functionsPython AST Parsing and Custom LintingPython GeneratorsPython itertools - The key to mastering iterationMagic Methods - Making Python builtins work with your classesUnlocking your CPU cores in Python (multiprocessing)x to bool conversion in Python, C++, and CWhich Python @dataclass is best? Feat. Pydantic, NamedTuple, attrs...What are Python __future__ imports?Python + YouTube API | Automating descriptions