Antony Lee added the comment:

This looks reasonable.  Note that the output of gettempdir is always passed as 
first argument to os.path.join (possibly via _mkstemp_inner), so perhaps you 
should rather define something like

def _absolute_child_of_parent_or_tmpdir(parent, *args):
    """Return the absolute child of parent, or gettempdir() if parent is None, 
given by *args.
    """
    if parent is None:
        parent = <_sanitize_dir> # inline the code here
    return _os.path.join(parent, *args)

and use that function instead.

This factorizes the code a little bit more and makes intent clearer (I don't 
think _sanitize_dir is a very clear name).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20267>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to