OOP Bootcamp2022 – Classes, Metaclasses, Dataclasses- Python

th_TPJuIDFFHRsIPVfhawajvXPU3kgqzp1B

对象的一个​​共同特征是过程(或方法)附加到它们并且可以访问和修改对象的数据字段。面向对象的编程使用对象,但并非所有相关的技术和结构都直接在声称支持 OOP 的语言中得到支持。它对操作数执行操作。

模块化编程支持提供了将过程分组到文件和模块中以用于组织目的的能力。模块是命名空间的,因此一个模块中的标识符不会与另一个文件或模块中共享相同名称的过程或变量冲突。

对象可以在其实例变量中包含其他对象;这称为对象组合。例如,Employee 类中的对象可能包含(直接或通过指针)Address 类中的对象,以及它自己的实例变量,如“first_name”和“position”。对象组合用于表示“has-a”关系:每个员工都有一个地址,因此每个 Employee 对象都可以访问存储地址对象的位置(直接嵌入在自身中,或者在通过指针寻址的单独位置) .

开发 OOP 是为了提高源代码的可重用性和可维护性。控制流的透明表示没有优先级,应该由编译器处理。随着并行硬件和多线程编码的相关性越来越高,开发透明的控制流变得更加重要,而这对于 OOP 来说是很难实现的。

在面向对象编程中,元类是一个类,其实例是类。正如普通类定义某些对象的行为一样,元类定义某些类及其实例的行为。并非所有面向对象的编程语言都支持元类。在那些这样做的人中,元类可以覆盖类行为的任何给定方面的程度各不相同。元类可以通过让类成为一等公民来实现,在这种情况下,元类只是一个构造类的对象。每种语言都有自己的元对象协议,一组管理对象、类和元类如何交互的规则。元编程一词是指程序了解或操纵自身的潜力。Python 支持一种称为元类的类元编程形式。

Build confidence on Python regular/meta/super/base/data classes – all about classes here!

Published 05/2022
MP4 | Video: h264, 1280×720 | Audio: AAC, 44.1 KHz, 2 Ch
Genre: eLearning | Language: English + srt | Duration: 17 lectures (5h 51m) | Size: 2.17 GB

What you’ll learn
Build expertise with classes
Learn how to do class instantiation properly and efficiently
Learn how to properly use metaclasses and why
Decorate classes and improve performance
Double the efficiency of the object oriented process
Identify differences in meta/super/base/child classes
Get strong in OOP
Verify class relations in the most effective way

Requirements
No requirements other than have some working level with python. We go step by step

Description
A common feature of objects is that procedures (or methods) are attached to them and can access and modify the object’s data fields. Object-oriented programming uses objects, but not all of the associated techniques and structures are supported directly in languages that claim to support OOP. It performs operations on operands.

Modular programming support provides the ability to group procedures into files and modules for organizational purposes. Modules are namespaced so identifiers in one module will not conflict with a procedure or variable sharing the same name in another file or module.

Objects can contain other objects in their instance variables; this is known as object composition. For example, an object in the Employee class might contain (either directly or through a pointer) an object in the Address class, in addition to its own instance variables like “first_name” and “position”. Object composition is used to represent “has-a” relationships: every employee has an address, so every Employee object has access to a place to store an Address object (either directly embedded within itself, or at a separate location addressed via a pointer).

OOP was developed to increase the reusability and maintainability of source code. Transparent representation of the control flow had no priority and was meant to be handled by a compiler. With the increasing relevance of parallel hardware and multithreaded coding, developing transparent control flow becomes more important, something hard to achieve with OOP.

In object-oriented programming, a metaclass is a class whose instances are classes. Just as an ordinary class defines the behavior of certain objects, a metaclass defines the behavior of certain classes and their instances. Not all object-oriented programming languages support metaclasses. Among those that do, the extent to which metaclasses can override any given aspect of class behavior varies. Metaclasses can be implemented by having classes be first-class citizens, in which case a metaclass is simply an object that constructs classes. Each language has its own metaobject protocol, a set of rules that govern how objects, classes, and metaclasses interact. The term metaprogramming refers to the potential for a program to have knowledge of or manipulate itself. Python supports a form of metaprogramming for classes called metaclasses.

Who this course is for
data analysts
data scientists
software engineers
pythonistas and experts alike
entrepreneurs

0ozjHxwu0ffdPNNcY077ZavU9VnWhgrW

资源下载此资源仅限VIP下载,请先
本站资源仅限VIP会员下载点击购买VIP会员

原创文章,作者:steven,如若转载,请注明出处:https://rr3d.cn/33491.html

赞 (0)
steven的头像steven
上一篇 2022年5月22日
下一篇 2022年5月22日

相关推荐

发表回复

登录后才能评论
分享本页
返回顶部