內建函式 :: dir

列出目前可視範圍的所有符號

dir()

列出所有內建符號

dir(__builtins__)

列出模組 sys 所定義(可存取)的所有符號

import sys

dir(sys)

列出類別 int 所定義(可存取)的所有符號 , 包含它的父類別所定義的所有符號

dir(int)

If called without an argument, return the names in the current scope. Else, return an alphabetized list of names comprising (some of) the attributes of the given object, and of attributes reachable from it. If the object supplies a method named __dir__, it will be used; otherwise the default dir() logic is used and returns:

  • for a module object: the module's attributes.
  • for a class object: its attributes, and recursively the attributes of its bases.
  • for any other object: its attributes, its class's attributes, and recursively the attributes of its class's base classes.

results matching ""

    No results matching ""