ソースを参照

Update sample code of `dir()` function

Update the sample code to be consistent with the following description:

> Notice that the list of imported modules is also part of this list.
Kamikat 8 年 前
コミット
169187e8e8
1 ファイル変更3 行追加3 行削除
  1. 3 3
      modules.md

+ 3 - 3
modules.md

@@ -146,19 +146,19 @@ $ python
 # get names of attributes for current module
 >>> dir()
 ['__builtins__', '__doc__',
-'__name__', '__package__']
+'__name__', '__package__', 'sys']
 
 # create a new variable 'a'
 >>> a = 5
 
 >>> dir()
-['__builtins__', '__doc__', '__name__', '__package__', 'a']
+['__builtins__', '__doc__', '__name__', '__package__', 'sys', 'a']
 
 # delete/remove a name
 >>> del a
 
 >>> dir()
-['__builtins__', '__doc__', '__name__', '__package__']
+['__builtins__', '__doc__', '__name__', '__package__', 'sys']
 ```
 
 **How It Works**