Cerca

Heus ací els resultats de la cerca.

5.1 Metaprogramming
127 Resultats, Darrera modificació:
= 5.1 Metaprogramming == Introduction to metaclasses Metaprogramming is a programming technique in whi... ability to modify their own or other programs’ codes. It may sound like an idea from a science fiction... iding operators, or even implementing the properties protocol. It may look like syntactic sugar, because in many cases metaprogramming allows programmers to minimize th
2.1 Python core syntax
103 Resultats, Darrera modificació:
using the “+” operator, but on respective data types. Now, we'll use the same function ''len()'' to g... form specific operations **on different** data types, when operations are formulated using **the same*... each instance of the class owns a set of attributes describing a person: age, salary, weight, etc. What does it mean to add two objects of the Person class? W
4.1 Shallow and deep copy operations
91 Resultats, Darrera modificació:
tion and the is operand; * shallow and deep copies of the objects. It’s hard to imagine writing a p... d of data processing without making use of variables. As variables are fundamental elements that allow us to cope with objects, let's talk in detail about variables and objects, and possible ways of copying them.
2.8 Composition vs Inheritance - two ways to the same destination
75 Resultats, Darrera modificació:
ng the inheritance concept when modeling our classes to represent real-life issues. Inheritance is a great concept, one of the most important foundations ... ing that models a tight relation between two classes: the base class and the derived class, called a s... that inherits **all** methods and **all** properties of the base class, and allows a subclass to exten
1.2 Working with class and instance data – instance variables
74 Resultats, Darrera modificació:
ng with class and instance data – instance variables == Instance variables This kind of variable exists when and only when it is explicitly created and ad... rty can be removed at any time. Each object carries its own set of variables – they don't interfere with one another in any way. The word instance sugges
1.1 Classes, Instances, Attributes, Methods — introduction
70 Resultats, Darrera modificació:
= 1.1 Classes, Instances, Attributes, Methods — introduction == Introduction to Object-Oriented Programming This module addresses the advanced Object Oriented Programming (OOP) is
2.2 Inheritance and polymorphism — Inheritance as a pillar of OOP
60 Resultats, Darrera modificació:
ncepts of object oriented programming, and expresses the fundamental relationships between classes: superclasses (parents) and their subclasses (descendants). Inheritance creates a class hierarchy. Any object bound
2.7 Encapsulation
54 Resultats, Darrera modificació:
itance, polymorphism, and abstraction). It describes the idea of bundling attributes and methods that work on those attributes within a class. Encapsulation is used to hide the **attributes** inside a class like in a **capsule**, preventin
2.4 Decorators
49 Resultats, Darrera modificació:
corator is one of the design patterns that describes the structure of related objects. Python is able to decorate functions, methods, and classes. The decorator's operation is based on wrapping ... later. Of course, the **decorating** function does more, because it can take the parameters of the d... e same principle is applied when we decorate classes. We'll talk about this a bit later. So from now
2.6 Abstract classes
49 Resultats, Darrera modificació:
= 2.6 Abstract classes Python is considered to be a very flexible programming language, but that doesn... e are no controls to impose a set of functionalities or an order in a class hierarchy. When you develo... some means of establishing requirements for classes in matters of interfaces (methods) exposed by each class. == What is an abstract class? An **abstract
2.5 Different faces of Python methods
40 Resultats, Darrera modificació:
= 2.5 Different faces of Python methods Until now, we’ve been implementing methods that have performed operations on the instances (objects), and in particular the attributes of the instance, so we’ve called them i**nstance methods*... iously existed. The code in the editor demonstrates the idea presented above. <code python> class Ex
4.2 Serialization of Python objects using the pickle module
33 Resultats, Darrera modificació:
for later use? The simplest way to persist outcomes is to generate a flat text file and to write your outcomes. It’s a very simple thing to do way which is not suitable for persisting sets of different types of objects or nested structures. In Python, object **serialization** is the process of converting an
2.9 Inheriting properties from built-in classes
32 Resultats, Darrera modificació:
= 2.9 Inheriting properties from built-in classes Python gives you the ability to create a class that inherits properties from any Python built-in class in order to get a
3.1 Advanced techniques of creating and serving exceptions
32 Resultats, Darrera modificació:
= 3.1 Advanced techniques of creating and serving exceptions In this module, we'll talk about Python e... on to exceptions; * review of the named attributes of exception objects; * introduction to chained... Exceptions - short introduction When Python executes a script and encounters a situation that it canno... cope with, it: * stops your program; * creates a special kind of data, called an **exception**.
4.3 Making Python objects persistent using the shelve module
13 Resultats, Darrera modificació:
e stream. Both serializing and deserializing parties must abide by the order of all the elements place... ings, because the underlying database (dbm) requires strings. Therefore, you can open your shelved da... s the way you do when you access Python dictionaries. This could be more convenient for you when you’r... Sound familiar? An analogy to the rack with shelves in the pantry is a correct one. Looks delicious,
2.3 Extended function argument syntax
12 Resultats, Darrera modificació: