This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Hammerite
Recipients Hammerite, benjamin.peterson, ezio.melotti, lemburg, loewis, pitrou, vstinner
Date 2015-03-03.00:09:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1425341369.08.0.718569071625.issue23550@psf.upfronthosting.co.za>
In-reply-to
Content
Here is an initial attempt at a patch that implements the new function.

Notes on this patch:

- The function as implemented here returns a string: "Yes", "No", or "Maybe". In light of the fact that Python now has enums, it is probably more appropriate that unicodedata contain an enum (QuickCheckValue, say) that has Yes, No and Maybe as values, and that the function return values from the enum. However, I do not know how to implement this in C and I do not know where I might look for an example of where something like this is done (in C) already in the CPython codebase, so I have not done that.

- My example code in the initial message on this issue was in error, as it assumed that the new function would return a Boolean value. In fact, there are three possible return values (Yes, No and Maybe), and corrected code would test the return value for equality with a string (as I have implemented the function) or for equality or identity with an enum value.

- When I first generated a patch, it was very long and consisted mostly of changes to three generated header files; these changes accounted for a total of about 60,000 lines' worth of patch file and appeared to be almost entirely spurious. Although one or more of these header files will genuinely be generated differently on account of my changes (a new string array _PyUnicode_QuickCheckNames is now present, along the same lines as the pre-existing 'Names' arrays), I have omitted them from the diff for being extremely bulky and for being generated code in any case.
History
Date User Action Args
2015-03-03 00:09:29Hammeritesetrecipients: + Hammerite, lemburg, loewis, pitrou, vstinner, benjamin.peterson, ezio.melotti
2015-03-03 00:09:29Hammeritesetmessageid: <1425341369.08.0.718569071625.issue23550@psf.upfronthosting.co.za>
2015-03-03 00:09:29Hammeritelinkissue23550 messages
2015-03-03 00:09:28Hammeritecreate