[Python-Dev] os.path.join failure mode (original) (raw)
Senthil Kumaran senthil at uthcode.com
Sun Feb 10 08:39:01 CET 2013
- Previous message: [Python-Dev] os.path.join failure mode
- Next message: [Python-Dev] Force to use Py_CLEAR and Py_VISIT in example for Python extending
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
And this is not just with Python. Try any other dynamic language (Ruby), send a function in place of a string and see failure msg. And if the question is really about path joins and path manipulations, then I believe PEP 428 ( http://www.python.org/dev/peps/pep-0428/) would be better candidate to address these scenarios.
On Sat, Feb 9, 2013 at 3:45 PM, Eric V. Smith <eric at trueblade.com> wrote:
On 2/9/2013 6:23 PM, Greg Ewing wrote:
Terry Reedy wrote:
I agree. Since the exception type is not documented and since no one should intentionally pass anything but strings, and therefore should not be writing
try: os.path.join(a,b) except AttributeError: barf() I think it would be acceptable to make a change in 3.4. Why should we go out of our way to address this particular case, and not any of the infinitely many other situations where you could forget to add parens to a function call? I agree we do not want to go down this slippery slope. The number of such places in the standard library is huge. The existing error message is one that a user should be able to understand, since it's so common. -- Eric.
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/senthil%40uthcode.com
- Previous message: [Python-Dev] os.path.join failure mode
- Next message: [Python-Dev] Force to use Py_CLEAR and Py_VISIT in example for Python extending
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]