Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 4.3 Making Python objects persistent using the shelve module
- eady for action, so let's insert a few items and close the shelve object. <code python> my_shelve['USD'... {'code':'Japanese yen', 'symbol': '¥'} my_shelve.close() </code> Now let's open the shelve file to dem... shelve_name) print(new_shelve['USD']) new_shelve.close() </code> The final code is presented in the ri... {'code':'Japanese yen', 'symbol': '¥'} my_shelve.close() new_shelve = shelve.open(shelve_name) print(n
- 2.4 Decorators
- and %%**%%kwargs concepts. We can also employ a closure technique to persist arguments. The code pres... ould reference an object (own_function) in its enclosing scope thanks to the closure. == Decorators can accept their own attributes In Python, we can creat... extend its behavior. Decorators rely heavily on closures and *args and %%**kwargs%%. Interesting note
- 1.2 Working with class and instance data – instance variables
- ny way. The word instance suggests that they are closely connected to the objects (which are class inst
- 2.5 Different faces of Python methods
- be inconsistent with the convention and the code loses its effectiveness in communicating its own mean
- 2.8 Composition vs Inheritance - two ways to the same destination
- extend. This phenomenon is known as the class explosion problem, and is one of the antipatterns of pro
- 2.9 Inheriting properties from built-in classes
- that logs activities. But don’t worry, we’re not losing anything from the parent dictionary class, bec
- 3.1 Advanced techniques of creating and serving exceptions
- riggers an additional exception. Should your code lose the information about the previous exception? Of