Introduce constant: `pathlib.null_path`

16 views
Skip to first unread message

Ram Rachum

unread,
Jan 4, 2014, 5:05:27 PM1/4/14
to python...@googlegroups.com
What do you think about introducing this constant in the `pathlib` module:

   null_path = pathlib.Path('\\Device\\Null') if os.name = 'nt' else pathlib.Path('/dev/null')


Thanks,
Ram.

Benjamin Peterson

unread,
Jan 4, 2014, 6:25:40 PM1/4/14
to python...@python.org
Ram Rachum <ram.rachum@...> writes:

=
What's wrong with pathlib.Path(os.devnull)?


_______________________________________________
Python-ideas mailing list
Python...@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Victor Stinner

unread,
Jan 4, 2014, 6:27:25 PM1/4/14
to python-ideas

There is already os.path.devnull.

Victor

Ram Rachum

unread,
Jan 4, 2014, 6:27:54 PM1/4/14
to python...@googlegroups.com, python-ideas
Cool, I didn't know about that. Thanks!


--

---
You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-ideas/eXtl40Ysgu8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-ideas...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages