en
Kitaplar
Dusty Phillips

Python 3 Object-oriented Programming – Second Edition

  • DDaudalagidalıntı yaptı2 yıl önce
    A subclass is also said to be derived from its parent class or that the subclass extends the parent.
  • DDaudalagidalıntı yaptı2 yıl önce
    As discussed in Chapter 1, Object-oriented Design, inheritance allows us to create is a relationships between two or more classes, abstracting common logic into superclasses and managing specific details in the subclass.
  • DDaudalagidalıntı yaptı2 yıl önce
    Minimizing the amount of code can often make a program easier to read, but do not blindly assume this is the case.
  • DDaudalagidalıntı yaptı2 yıl önce
    In contrast, the object-oriented code is relatively self-documenting, we just have to look at the list of methods and their parameters to know what the object does and how to use it.
  • DDaudalagidalıntı yaptı2 yıl önce
    There is no reason to add an extra level of abstraction if it doesn't help organize our code.
  • DDaudalagidalıntı yaptı2 yıl önce
    Remember, objects are things that have both data and behavior.
  • DDaudalagidalıntı yaptı2 yıl önce
    On the other hand, if we are working only with behavior, but no stored data, a simple function is more suitable.
  • DDaudalagidalıntı yaptı2 yıl önce
    If we are working only with data, we are often better off storing it in a list, set, dictionary, or some other Python data structure (which we'll be covering thoroughly in Chapter 6, Python Data Structures).
  • DDaudalagidalıntı yaptı2 yıl önce
    Remember to design and document any self-raised exceptions as part of the API, or they won't know whether or how to handle them!
  • DDaudalagidalıntı yaptı2 yıl önce
    If you've never dealt with exceptions before, the first thing you need to do is look at any old Python code you've written and notice if there are places you should have been handling exceptions.
fb2epub
Dosyalarınızı sürükleyin ve bırakın (bir kerede en fazla 5 tane)