浏览代码

dir(print) is not valid in Python 2

It is valid only in Python 3.

Thanks to jemshad.ok@gmail.com for alerting me about this!
Swaroop C H 10 年之前
父节点
当前提交
86b4729bb8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules.asciidoc

+ 2 - 2
modules.asciidoc

@@ -264,8 +264,8 @@ A note on `del` - this statement is used to *delete* a variable/name and after t
 run, in this case `del a`, you can no longer access the variable `a` - it is as if it never existed
 run, in this case `del a`, you can no longer access the variable `a` - it is as if it never existed
 before at all.
 before at all.
 
 
-Note that the `dir()` function works on *any* object. For example, run `dir(print)` to learn
-about the attributes of the print function, or `dir(str)` for the attributes of the str class.
+Note that the `dir()` function works on *any* object. For example, run `dir(str)` for the
+attributes of the `str` (string) class.
 
 
 There is also a http://docs.python.org/2/library/functions.html#vars[`vars()`] function which can
 There is also a http://docs.python.org/2/library/functions.html#vars[`vars()`] function which can
 potentially give you the attributes and their values, but it will not work for all cases.
 potentially give you the attributes and their values, but it will not work for all cases.