You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2012-02-09.22:40:50.992>created_at=<Date2012-02-09.22:12:58.072>labels= ['interpreter-core', 'invalid']
title='getcwd problem does not return cwd'updated_at=<Date2012-02-09.22:40:50.990>user='https://bugs.python.org/fif0'
At the first call of the methode foo(), path and the second getcwd are the same. After the directory change, the default value path is not the the current working directory.
That's just how function definitions in Python work. The prototype is evaluated when the function is defined, not when it is run, so the default value of path will always be the value of getcwd at the time the function *defintion* is done (which will generally be the CWD when python starts, unless you are defining functions at runtime).
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: