This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author techtonik
Recipients techtonik
Date 2011-09-19.14:21:23
SpamBayes Score 1.1283974e-11
Marked as misclassified No
Message-id <1316442084.93.0.49113454288.issue13008@psf.upfronthosting.co.za>
In-reply-to
Content
This is self-explanative. Function definitions are identical. Syntax error caused by the absence of empty line after the function definition.

Python 2.7.1 (r271:86832, Apr 12 2011, 16:16:18) 
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os

>>> def get_size(start_path = '.'):
...     total_size = 0
...     for dirpath, dirnames, filenames in os.walk(start_path):
...         for f in filenames:
...             fp = os.path.join(dirpath, f)
...             total_size += os.path.getsize(fp)
...     return total_size
... 
>>> print get_size()
1595969238
>>> def get_size(start_path = '.'):
...     total_size = 0
...     for dirpath, dirnames, filenames in os.walk(start_path):
...         for f in filenames:
...             fp = os.path.join(dirpath, f)
...             total_size += os.path.getsize(fp)
...     return total_size
... print get_size()
  File "<stdin>", line 8
    print get_size()
        ^
SyntaxError: invalid syntax
History
Date User Action Args
2011-09-19 14:21:25techtoniksetrecipients: + techtonik
2011-09-19 14:21:24techtoniksetmessageid: <1316442084.93.0.49113454288.issue13008@psf.upfronthosting.co.za>
2011-09-19 14:21:24techtoniklinkissue13008 messages
2011-09-19 14:21:23techtonikcreate