Some things mean nothing at any time, such as integers, and what you see is what it says. As with keywords, you can't use def,class these keywords as variable names, so when you see them, it's easy to know what they do. But there are a lot of things
Before introducing the self usage of Python, let's introduce the classes and instances in PythonWe know that the most important concept of object-oriented is the classes (class) and the instance (instance).A class is an abstract template, such as a
#!/usr/bin/env python#-*-coding:utf-8-*-#@Time: 2017/11/08 8:46#@Author: Lijunjiang#@File: class3.py"""The private and private methods of a class can be defined in Python by adding a double underscore to the property variable name, a special
By 2027, the global real private cloud (true private CLOUD,TPC) market will reach $262.4 billion, with an annual CAGR of 29.2%, while the TPC market will grow faster than the public cloud IaaS market, while the locally deployed TPC market will be 32.
Say in front of the point:Python clearly has a private way of defining the method is to add a double glide line in front of the variable or method, which is actually a python pseudo-private. It's just a programmer's agreement that the rules are
01, application scenario and definition mode application scenario
In real-world development, some properties or methods of an object may only want to be used inside an object and not be externally accessible to
A private property is a
first, the new old class of Python object-oriented 1) New Class (recommended): When defining a class, the class is followed by the base class (object) in parentheses. In python3.x, if the parent class is not specified, object is used as the base
The modifier private provides the highest protection and lowest visibility: The private decorated domain, method, and nested type, which can only be accessed in its definition class.6.3.1 PrivateThere will be some procedural restrictions in the
constructor: __init__ ()Intro: Because everyone is born different. Therefore, if there is a problem in assigning a value directly to the class element in the person class, it will cause everyone to have the same initial state, which is incompatible
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.