[go: up one dir, main page]

Make filenames in writers/readers mandatory

We have some methods with signatures like write(self, filename='filename.xxx').

These methods resolve their filename relative to PWD. If the caller wants to save elsewhere, there's no way to programmatically say "use the default filename but in this directory" -- except via introspection which is awkward.

Also, having a filename chosen automatically means the user has no programmatic way to see which file was written. Only up-front knowledge about which default name was hardcoded.

I propose that we make the filename mandatory (after a deprecation period) in all functions and methods with the above pattern. That way things are always explicit: def write(self, filename), where the user specifies the path/filename always.

Edited by Ask Hjorth Larsen