[issue9921] os.path.join('x','') behavior
Radu Grigore radugrig...@gmail.com added the comment: posixpath.py's comment says -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9921] os.path.join('x','') behavior
Radu Grigore radugrig...@gmail.com added the comment: Realizing I still don't know what os.join.path does, I looked at the source. The comment in posixpath.py is: # Ignore the previous parts if a part is absolute. # Insert a '/' unless the first part is empty or already ends in '/'. I find this clear and it directly corresponds to the implementation. On the other hand, the source of ntpath.join() is a nightmare, and there's no similarly simple comment there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9921] os.path.join('x','') behavior
Changes by Radu Grigore radugrig...@gmail.com: -- nosy: -rgrig ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9921] os.path.join('x','') behavior
Radu Grigore radugrig...@gmail.com added the comment: I would say something like the following. The function join(path1, path2) is almost like os.sep.join(path1, path2), but (1) trailing path separators in path1 are ignored and (2) the result is simply path2 when path2 is an absolute path. The call join(path1, path2, path3) is equivalent to join(join(path1, path2), path3), and similarly for more than three paths. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9921] os.path.join('x','') behavior
New submission from Radu Grigore radugrig...@gmail.com: The docs say that the return value is the concatenation of path1, and optionally path2, etc., with exactly one directory separator (os.sep) inserted between components, unless path2 is empty. But os.path.join('x','') returns 'x/' in which path1 and path2 *are* separated by exactly one os.sep, even though path2 is empty. Either the docs or the implementation should be updated. -- components: Library (Lib) messages: 117146 nosy: rgrig priority: normal severity: normal status: open title: os.path.join('x','') behavior versions: Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: How to get the minimum number that can be represented?
On Sep 20, 1:15 pm, Peng Yu pengyu...@gmail.com wrote: The problem is how to know what type of the argument and call the corresponding function. type(1) type 'int' type(1.2) type 'float' -- http://mail.python.org/mailman/listinfo/python-list