summaryrefslogtreecommitdiffstats
path: root/Lib/newdir.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
commitb6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af (patch)
tree9362939305b2d088b8f19a530c9015d886bc2801 /Lib/newdir.py
parent2979b01ff88ac4c5b316d9bf98edbaaaffac8e24 (diff)
downloadcpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.zip
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.gz
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.bz2
Merge alpha100 branch back to main trunk
Diffstat (limited to 'Lib/newdir.py')
-rw-r--r--Lib/newdir.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/newdir.py b/Lib/newdir.py
index 26a7df0..937c49e 100644
--- a/Lib/newdir.py
+++ b/Lib/newdir.py
@@ -65,11 +65,9 @@ def is_function(x):
# Approximation of builtin dir(); but note that this lists the user's
# variables by default, not the current local name space.
-def dir(*args):
- if len(args) > 0:
- if len(args) == 1:
- args = args[0]
- return listattrs(args)
+def dir(x = None):
+ if x is not None:
+ return listattrs(x)
else:
import __main__
return listattrs(__main__)