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 benrg
Recipients benrg, eryksun, paul.moore, r.david.murray, steve.dower, tim.golden, tzickel, zach.ware
Date 2022-02-26.22:10:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645913423.06.0.727059274858.issue28824@roundup.psfhosted.org>
In-reply-to
Content
This issue should be marked dependent on issue 43702 or issue 46862, since fixing it could break third-party code unless they're fixed first.


> Given 'nt.environ' is available without case remapping, I think that's the best workaround.

Right now, it's not a good workaround because it contains the environment at the time the interpreter was started, not the current environment. On Posix, _Environ takes a reference to posix.environ and uses it directly, so it does get updated. On Windows, _Environ gets a rewritten dictionary and nt.environ is just a space-wasting attractive nuisance. I think it should be replaced with getenviron() which builds a dict from the environment block each time it's called. But posix.environ is documented (though nt.environ isn't), so maybe not.


> class _CaseInsensitiveString(str):

I think there should be a public class like this. It could be useful to email.message.Message and its clients like urllib. They currently store headers in a list and every operation is O(n).

The semantics are tricky. As written, it violates the requirement that equal objects have equal hashes. To fix that, you'd have to make every CIS compare unequal to every str. At that point, it probably shouldn't be a str subclass, which also has the advantage that it's not limited to strings. It can be a generic compare-by-key wrapper.
History
Date User Action Args
2022-02-26 22:10:23benrgsetrecipients: + benrg, paul.moore, tim.golden, r.david.murray, zach.ware, eryksun, steve.dower, tzickel
2022-02-26 22:10:23benrgsetmessageid: <1645913423.06.0.727059274858.issue28824@roundup.psfhosted.org>
2022-02-26 22:10:23benrglinkissue28824 messages
2022-02-26 22:10:22benrgcreate