[issue34926] Adding "mime_type" method to pathlib.Path

2018-10-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would rather have the mimetypes module improved to accept Path-like objects, so that the following works: >>> p = Path('LICENSE.txt') >>> mimetypes.guess_type(p) ('text/plain', None) It should be quite simple to implement as well. -- components:

[issue34926] Adding "mime_type" method to pathlib.Path

2018-10-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. There was a similar request to add pathlib.rmtree (issue33498) and adding more methods as Raymond mentioned might be convenient but there is a maintenance cost (msg316517) since there is a consensus that pathlib should do

[issue34926] Adding "mime_type" method to pathlib.Path

2018-10-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 There is some value in having a separation of responsibilities and in not adding another dependency. On the other hand, I can see how this would sometimes be convenient. Assigning to Antoine to make the decision. -- assignee: -> pitrou

[issue34926] Adding "mime_type" method to pathlib.Path

2018-10-08 Thread YoSTEALTH
Change by YoSTEALTH : -- components: -Extension Modules ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34926] Adding "mime_type" method to pathlib.Path

2018-10-08 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- title: Adding "mine_type" method to pathlib.Path -> Adding "mime_type" method to pathlib.Path ___ Python tracker ___