Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Georg Brandl wrote: >>> I'm sorry, that's not good enough. How, precisely, would it break >>> "existing code"? Can you come up with an example, or even an >>> explanation of how it *could* break existing code? >> Is that so hard to see? If cgi.escape replaced "'" with an entity reference, >> code that expects it not to do so would break. > > Sorry, that's still not good enough. Why would any code expect such a > thing?
Plenty of test suites for a start. A non-backwards compatible change such as being suggested can create a huge maintenance burden on lots of people. People also use that function to escape non-HTML too - if they are using it as documented, and it produces the correct results for them, great. Note that the documentation doesn't say that input has to be HTML, nor that output must be used as HTML. It just describes the transformation that it does clearly and unambiguously and can quite happily be used for generating quoted text for use in, say, XML documents. Also, because Python has a conservative policy on backwards incompatible changes, you are protected from some wanker going and changing the HTML safe mappings arbitrarily, say using numerical entity references instead of >, < and &. This policy allows large software projects to be developed in Python and maintained with less pain than if they were written in languages with a less conservative policy. If you want to improve the situation, join the WEB-SIG to help design new and improved APIs so that the existing ones like the ancient cgi module can be deprecated. Or maybe just some helpers can be added to the existing htmllib module? There are better approaches than making non-backwards compatible changes to functions people have been relying on since Python 1.5. -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list