<br><br><div><span class="gmail_quote">On 8/6/07, <b class="gmail_sendername">Guido van Rossum</b> <<a href="mailto:email@example.com">firstname.lastname@example.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 8/6/07, "Martin v. L÷wis" <<a href="mailto:email@example.com">firstname.lastname@example.org</a>> wrote:<br>> >> If that is not acceptable, please tell me how else<br>> >> to fix the dbm modules.
<br>> ><br>> > By fixing the code that uses them?<br>><br>> I don't know how to do that. All implementation strategies I<br>> can think of have significant drawbacks.<br><br>Can you elaborate about the issues?
<br><br>> > By using str8 (perhaps renamed to<br>> > frozenbytes and certainly stripped of its locale-dependent APIs)?<br>><br>> Ok. So you could agree to a frozenbytes type, then? I'll add one,<br>> reusing the implementation of the bytes object.
<br><br>Not quite. It's the least evil. I'm hoping to put off the decision.<br><br>Could you start using str8 instead for now? Or is that not usable for<br>a fix? (If so, why not?)<br><br>> If that is done:<br>
><br>> a) should one of these be the base type of the other?<br><br>No. List and tuple don't inherit from each other, nor do set and<br>frozenset. A common base class is okay. (We didn't quite do this for<br>
sets but it makes sense for Py3k to change this.)<br><br>> b) should bytes literals be regular or frozen bytes?<br><br>Regular -- set literals produce mutable sets, too.</blockquote><div><br>But all other string literals produce immutable types:
<br><br>""<br>r""<br>u"" (going away, but still)<br>and hopefully b""<br><br>Wouldn't it be confusing to have b"" be the only mutable quote-delimited literal? For everything else, there's bytes().
<br><br>:-)<br><br>- C<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> c) is it still ok to provide a .freeze() method on<br>
> bytes returning frozenbytes?<br><br>I'd rather use the same kind of API used between set and frozenset:<br>each constructor takes the other as argument.<br><br>> d) should unicode.defenc be frozen?<br><br>Yes. It's currently a str8 isn't it? So that's already the case.
<br><br>> e) should (or may) codecs return frozenbytes?<br><br>I think it would be more convenient and consistent if all APIs<br>returned mutable bytes and the only API that creates frozen bytes was<br>the frozen bytes constructor. (defenc excepted as it's a C-level API
<br>and having it be mutable would be bad.)<br><br>--<br>--Guido van Rossum (home page: <a href="http://www.python.org/~guido/">http://www.python.org/~guido/</a>)<br>_______________________________________________<br>Python-3000 mailing list
<br><a href="mailto:Pythonemail@example.com">Pythonfirstname.lastname@example.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-3000">http://mail.python.org/mailman/listinfo/python-3000</a><br>Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/shiblon%40gmail.com">