Author ncoghlan
Recipients eric.araujo, eric.smith, ncoghlan, r.david.murray
Date 2010-09-28.14:00:53
SpamBayes Score 1.44769e-07
Marked as misclassified No
Message-id <1285682459.92.0.904226596529.issue9873@psf.upfronthosting.co.za>
In-reply-to
Content
Attached patch is a very rough first cut at this. I've gone with the basic approach of simply assigning the literals to local variables in each function that uses them. My rationale for that is:
1. Every function has to have some kind of boilerplate to switch based on the type of the argument
2. Some functions need to switch other values (such as the list of scheme_chars or the unparse function), so a separate object with literal attributes won't be enough
3. Given 1 and 2, the overhead of a separate namespace for the literal references isn't justified

I've also gone with a philosophy that only str objects are treated as strings and everything else is implicitly assumed to be bytes. This is in keeping with the general interpreter behaviour where we *really* don't support duck-typing when it comes to strings.

The test updates aren't comprehensive yet, but they were enough to uncover quite a few things I had missed.

quoting is still a bit ugly, so I may still add a byte->bytes/str->str variant of those APIs.
History
Date User Action Args
2010-09-28 14:01:00ncoghlansetrecipients: + ncoghlan, eric.smith, eric.araujo, r.david.murray
2010-09-28 14:00:59ncoghlansetmessageid: <1285682459.92.0.904226596529.issue9873@psf.upfronthosting.co.za>
2010-09-28 14:00:57ncoghlanlinkissue9873 messages
2010-09-28 14:00:56ncoghlancreate