Cerca

Heus ací els resultats de la cerca.

5.1 Metaprogramming
158 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
146 Resultats, Darrera modificació:
and floats. It’s natural for us to formulate expressions using algebraic symbols representing operators, or to get a number of elements in a sequence or ... able to add two or more strings together, which results in the strings’ concatenation; we are able to add integers and we know what the result should be, all done by using the “+” operator,
4.1 Shallow and deep copy operations
134 Resultats, Darrera modificació:
tion and the is operand; * shallow and deep copies of the objects. It’s hard to imagine writing a p... of Python code that performs any kind 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
2.8 Composition vs Inheritance - two ways to the same destination
122 Resultats, Darrera modificació:
omposition vs Inheritance - two ways to the same destination So far we've been using and following the inheritance concept when modeling our classes to represent real-life issues. Inheritance is a great concept, one of the most important foundations of object-
2.6 Abstract classes
116 Resultats, Darrera modificació:
= 2.6 Abstract classes Python is considered to be a very flexible programming language, but that doesn’t mean that there are no controls to impose a set of functionalities or an order in a class hierarchy. When you develo... rammers, it would be useful to have some means of establishing requirements for classes in matters of
2.7 Encapsulation
108 Resultats, Darrera modificació:
inheritance, 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 **attrib
1.2 Working with class and instance data – instance variables
104 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
99 Resultats, Darrera modificació:
= 1.1 Classes, Instances, Attributes, Methods — introduction == Introduction to Object-Oriented Programming This module addresses the advanced Object Oriented Programming (OOP)
2.4 Decorators
98 Resultats, Darrera modificació:
= 2.4 Decorators A decorator 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
2.2 Inheritance and polymorphism — Inheritance as a pillar of OOP
94 Resultats, Darrera modificació:
concepts of object oriented programming, and expresses the fundamental relationships between classes: superclasses (parents) and their subclasses (descendants). Inheritance creates a class hierarchy. An
2.9 Inheriting properties from built-in classes
73 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
4.2 Serialization of Python objects using the pickle module
68 Resultats, Darrera modificació:
n objects for later use. **Pickling** is the process of preserving or extending the lifespan of food. The resulting food is called a pickle, and to prevent ambiguity, prefaced with the 'pickl
2.5 Different faces of Python methods
67 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*... tance. Of course, it follows that in order to successfully use the instance method, the instance must
3.1 Advanced techniques of creating and serving exceptions
62 Resultats, Darrera modificació:
= 3.1 Advanced techniques of creating and serving exceptions In this module, we'll talk about Python exceptions – objects that represent errors which occur during the execution of a p... 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
4.3 Making Python objects persistent using the shelve module
25 Resultats, Darrera modificació:
ts as a single byte stream. Both serializing and deserializing parties must abide by the order of all the elements placed into a file or database, or sent... ings, because the underlying database (dbm) requires strings. Therefore, you can open your shelved data file and access your pickled objects via the keys the way you do
2.3 Extended function argument syntax
19 Resultats, Darrera modificació: