"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
That may actually be a genuinely useful approach:

splitext(name, ignore_leading_dot=False, all_ext=False)

   Split the extension from a pathname. Returns "(root, ext)".
   By default, the extension is all characters from the last dot to the
end of the string. "ext" will be empty if there are no dots in the name
and "root" will be empty if the characters starts with a single dot and
that is the only dot in the name.
   If ignore_leading_dot=True, then a leading dot is always considered
part of "root", and is ignored when determining the extension. "root"
will never be empty in this case.
   If all_ext=True, the extension is all characters from the first dot to
the end.

=====================================
'first dot' => 'first non-ignored dot'
in case both options are true.

In the long run (in 3.0), I think ignore_leading_dot should default to True 
rather than False since I think that is what more people will want. 
However, I believe the 2-to-3 converter could remove 
'ignore_leading_dot=True' and insert 'ignore_leading_dot=False' as needed.

Terry Jan Reedy



_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to