Meador Inge added the comment:

I agree that the general case is complicated.  It will get even more 
complicated if the full of PEP 3118 gets implemented since it turns into a tree 
comparison.  In general, I think you will probably have to compute some 
canonical form and then compare the canonical forms.

Here are a few more cases that don't work out in the attached algorithm:

  1. Repeat characters - '2c' == 'cc'
  2. Whitespace - 'h   h' == 'hh' 

Also, currently the byte order specifiers are always at the beginning of the 
string.  We discussed in issue3132 scoping them per the nested structures, but 
decided to drop that unless somebody barks about it since it is fairly 
complicated without a clear benefit.  So, I wouldn't worry about them being 
scattered through the string.

This seems like sort of a slippery slope.  I need to think about it more, but 
my first impression is that coming up with some way to compare format strings 
is going to be nasty.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15573>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to