<br><br><div><span class="gmail_quote">On 8/6/07, <b class="gmail_sendername">Guido van Rossum</b> &lt;<a href="mailto:guido@python.org">guido@python.org</a>&gt; 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, &quot;Martin v. Löwis&quot; &lt;<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</a>&gt; wrote:<br>&gt; &gt;&gt; If that is not acceptable, please tell me how else<br>&gt; &gt;&gt; to fix the dbm modules.
<br>&gt; &gt;<br>&gt; &gt; By fixing the code that uses them?<br>&gt;<br>&gt; I don&#39;t know how to do that. All implementation strategies I<br>&gt; can think of have significant drawbacks.<br><br>Can you elaborate about the issues?
<br><br>&gt; &gt; By using str8 (perhaps renamed to<br>&gt; &gt; frozenbytes and certainly stripped of its locale-dependent APIs)?<br>&gt;<br>&gt; Ok. So you could agree to a frozenbytes type, then? I&#39;ll add one,<br>&gt; reusing the implementation of the bytes object.
<br><br>Not quite. It&#39;s the least evil. I&#39;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>&gt; If that is done:<br>
&gt;<br>&gt; a) should one of these be the base type of the other?<br><br>No. List and tuple don&#39;t inherit from each other, nor do set and<br>frozenset. A common base class is okay. (We didn&#39;t quite do this for<br>
sets but it makes sense for Py3k to change this.)<br><br>&gt; 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>&quot;&quot;<br>r&quot;&quot;<br>u&quot;&quot; (going away, but still)<br>and hopefully b&quot;&quot;<br><br>Wouldn&#39;t it be confusing to have b&quot;&quot; be the only mutable quote-delimited literal?&nbsp; For everything else, there&#39;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;">&gt; c) is it still ok to provide a .freeze() method on<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;bytes returning frozenbytes?<br><br>I&#39;d rather use the same kind of API used between set and frozenset:<br>each constructor takes the other as argument.<br><br>&gt; d) should unicode.defenc be frozen?<br><br>Yes. It&#39;s currently a str8 isn&#39;t it? So that&#39;s already the case.
<br><br>&gt; 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&#39;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:Python-3000@python.org">Python-3000@python.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">
http://mail.python.org/mailman/options/python-3000/shiblon%40gmail.com</a><br></blockquote></div><br>