Browse Source

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 11 years ago
parent
commit
86b4729bb8
1 changed files with 2 additions and 2 deletions
  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.