[issue19777] Provide a home() classmethod on Path objects
STINNER Victor added the comment: +def _test_home(self, p): +q = self.cls(os.path.expanduser('~')) +self.assertEqual(p, q) +self.assertEqual(str(p), str(q)) +self.assertIs(type(p), type(q)) +self.assertTrue(p.is_absolute()) + +def test_home(self): +p = self.cls.home() +self._test_home(p) Why are you using a submethod _test_home()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Roundup Robot added the comment: New changeset 4a55b98314cd by Antoine Pitrou in branch 'default': Issue #19777: Provide a home() classmethod on Path objects. https://hg.python.org/cpython/rev/4a55b98314cd -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Antoine Pitrou added the comment: I've committed the patch, thank you! -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
STINNER Victor added the comment: I agree that Path.home() is more user friendly than Path.expanduser('~'). -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Mayank Tripathi added the comment: Added docs to mcsalgado's patch. -- nosy: +oquanox Added file: http://bugs.python.org/file37595/home.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Changes by Antoine Pitrou pit...@free.fr: -- keywords: +easy stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Changes by Victor Salgado victor.mcsalg...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file37581/path_home.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Changes by Victor Salgado victor.mcsalg...@gmail.com: Added file: http://bugs.python.org/file37582/path_home2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Changes by Kevin J Pallan kevinjpal...@gmail.com: -- nosy: +artifex93 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Antoine Pitrou added the comment: IMO, this functionality is subsumed by http://bugs.python.org/issue19776 Roughly, yes, but it can also be a useful convenience (expanduser('~') isn't that user-friendly, especially for Windows users). -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
New submission from Antoine Pitrou: Similar to Path.cwd(), perhaps a Path.home() to create a new Path object pointing to the current user's home directory may be useful. -- components: Library (Lib) messages: 204388 nosy: pitrou priority: low severity: normal status: open title: Provide a home() classmethod on Path objects type: enhancement versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19777] Provide a home() classmethod on Path objects
Charles-François Natali added the comment: IMO, this functionality is subsumed by http://bugs.python.org/issue19776 (Path.expanduser). -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com