diff options
Diffstat (limited to 'docs/RulePackage/getStart')
| -rw-r--r-- | docs/RulePackage/getStart/attribute.md | 12 | ||||
| -rw-r--r-- | docs/RulePackage/getStart/class.md | 6 | ||||
| -rw-r--r-- | docs/RulePackage/getStart/getDeeper/Module.md | 14 | ||||
| -rw-r--r-- | docs/RulePackage/getStart/getDeeper/Package.md | 12 | ||||
| -rw-r--r-- | docs/RulePackage/getStart/getDeeper/object.md | 8 | ||||
| -rw-r--r-- | docs/RulePackage/getStart/method.md | 10 |
6 files changed, 62 insertions, 0 deletions
diff --git a/docs/RulePackage/getStart/attribute.md b/docs/RulePackage/getStart/attribute.md new file mode 100644 index 00000000..70deeb06 --- /dev/null +++ b/docs/RulePackage/getStart/attribute.md @@ -0,0 +1,12 @@ +--- +title: attribute 属性 +--- + +!!! info + 关联到一个对象的值,通常使用点号表达式按名称来引用。 举例来说,如果对象 o 具有属性 a 则可以用 o.a 来引用它。 + + 如果对象允许,将未被定义为 [标识符和关键字] 的非标识名称用作一个对象的属性也是可以的,例如使用 [setattr()]。 这样的属性将无法使用点号表达式来访问,而是必须通过 [getattr()] 来获取。 + + [标识符和关键字]: https://docs.python.org/zh-cn/3/reference/lexical_analysis.html#identifiers + [setattr()]: https://docs.python.org/zh-cn/3/library/functions.html#setattr + [getattr()]:https://docs.python.org/zh-cn/3/library/functions.html#getattr
\ No newline at end of file diff --git a/docs/RulePackage/getStart/class.md b/docs/RulePackage/getStart/class.md new file mode 100644 index 00000000..a6628452 --- /dev/null +++ b/docs/RulePackage/getStart/class.md @@ -0,0 +1,6 @@ +--- +title: class 类 +--- + +!!! info + 用来创建用户定义对象的模板。类定义通常包含对该类的实例进行操作的方法定义。
\ No newline at end of file diff --git a/docs/RulePackage/getStart/getDeeper/Module.md b/docs/RulePackage/getStart/getDeeper/Module.md new file mode 100644 index 00000000..91438ee5 --- /dev/null +++ b/docs/RulePackage/getStart/getDeeper/Module.md @@ -0,0 +1,14 @@ +--- +title: Module 模块 +--- +!!! info + 此对象是 Python 代码的一种组织单位。各模块具有独立的命名空间,可包含任意 Python 对象。模块可通过 [importing] 操作被加载到 Python 中。 + + 另见 [package]。 + + [importing]: https://docs.python.org/zh-cn/3/glossary.html#term-importing + [package]: ../Package + + + +:material-information-outline:{ title="Important information" } diff --git a/docs/RulePackage/getStart/getDeeper/Package.md b/docs/RulePackage/getStart/getDeeper/Package.md new file mode 100644 index 00000000..c683d5d6 --- /dev/null +++ b/docs/RulePackage/getStart/getDeeper/Package.md @@ -0,0 +1,12 @@ +--- +title: Package 包 +--- + +!!! info + 一种可包含子模块或递归地包含子包的 Python [module]。 从技术上说,包是具有 __path__ 属性的 Python 模块。 + + 另参见 [regular package] 和 [namespace package]。 + + [module]: ../Module + [regular package]: https://docs.python.org/zh-cn/3/glossary.html#term-regular-package + [namespace package]: https://docs.python.org/zh-cn/3/glossary.html#term-namespace-package
\ No newline at end of file diff --git a/docs/RulePackage/getStart/getDeeper/object.md b/docs/RulePackage/getStart/getDeeper/object.md new file mode 100644 index 00000000..f9a801a6 --- /dev/null +++ b/docs/RulePackage/getStart/getDeeper/object.md @@ -0,0 +1,8 @@ +--- +title: object 对象 +--- + +!!! info + 任何具有状态(属性或值)以及预定义行为(方法)的数据。object 也是任何 [new-style class] 的最顶层基类名。 + + [new-style class]: https://docs.python.org/zh-cn/3/glossary.html#term-new-style-class
\ No newline at end of file diff --git a/docs/RulePackage/getStart/method.md b/docs/RulePackage/getStart/method.md new file mode 100644 index 00000000..00e58149 --- /dev/null +++ b/docs/RulePackage/getStart/method.md @@ -0,0 +1,10 @@ +--- +title: method 方法 +--- + +!!! info + 在类内部定义的函数。如果作为该类的实例的一个属性来调用,方法将会获取实例对象作为其第一个 [argument] (通常命名为 self)。参见 [function] 和 [nested scope]。 + + [argument]: https://docs.python.org/zh-cn/3/glossary.html#term-argument + [function]: https://docs.python.org/zh-cn/3/glossary.html#term-function + [nested scope]:https://docs.python.org/zh-cn/3/glossary.html#term-nested-scope
\ No newline at end of file |
