bookmate game
en
Kitaplar

Mastering Object-oriented Python

  • DDaudalagidalıntı yaptı9 ay önce
    For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval().
  • DDaudalagidalıntı yaptı9 ay önce
    We initialize an object by implementing the __init__() method. When an object is created, Python first creates an empty object and then calls the __init__() method for that new object. This method function generally creates the object's instance variables and performs any other one-time processing.
  • DDaudalagidalıntı yaptı9 ay önce
    We can see that a class is an object of the class named type and that the base class for our new class is the class named object.
  • DDaudalagidalıntı yaptı9 ay önce
    Because there are so many ways to provide argument values to __init__(), there is a vast array of use cases for object creation.
  • DDaudalagidalıntı yaptı9 ay önce
    Initialization is the first big step in an object's life; every object must be initialized properly to work properly.
  • DDaudalagidalıntı yaptı9 ay önce
    The __init__() method permits a great deal of latitude in providing the initial values for an object. In the case of an immutable object, this is the essential definition of the instance, and clarity becomes very important.
  • DDaudalagidalıntı yaptıgeçen yıl
    Besides the level of sophistication, one other difference between properties and attributes is that we can't attach new properties to an existing object easily; however, we can add attributes to an object easily, by default.
  • DDaudalagidalıntı yaptıgeçen yıl
    A property is actually a method function and can process, rather than simply preserve, a reference to another object.
  • DDaudalagidalıntı yaptıgeçen yıl
    A property is a method function that appears (syntactically) to be a simple attribute. We can get, set, and delete property values similarly to how we can get, set, and delete attribute values
  • DDaudalagidalıntı yaptıgeçen yıl
    An optional attribute pushes the edge of the envelope for class definition.

    Un atributo opcional empuja el borde de la envolvente para la definición de clase.

fb2epub
Dosyalarınızı sürükleyin ve bırakın (bir kerede en fazla 5 tane)