Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
49413418
Commit
49413418
authored
May 19, 1998
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
guess_extension(): Revise documentation string to be more clear. If not
inited, call init().
parent
5f4fb913
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Lib/mimetypes.py
Lib/mimetypes.py
+6
-3
No files found.
Lib/mimetypes.py
View file @
49413418
...
@@ -71,10 +71,13 @@ def guess_extension(type):
...
@@ -71,10 +71,13 @@ def guess_extension(type):
Return value is a string giving a filename extension, including the
Return value is a string giving a filename extension, including the
leading dot ('.'). The extension is not guaranteed to have been
leading dot ('.'). The extension is not guaranteed to have been
associated with any particular data stream, but
has been known to b
e
associated with any particular data stream, but
would be mapped to th
e
used for streams of the MIME type given by `type'. If `type' is not
MIME type `type' by guess_type(). If no extension can be guessed for
known
, None is returned.
`type'
, None is returned.
"""
"""
global
inited
if
not
inited
:
init
()
type
=
string
.
lower
(
type
)
type
=
string
.
lower
(
type
)
for
ext
,
stype
in
types_map
.
items
():
for
ext
,
stype
in
types_map
.
items
():
if
type
==
stype
:
if
type
==
stype
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment