<div dir="ltr">I think that "database" as the property identifier carries too much baggage -- there are too many meanings of, and too much use of the term, therefore it is not immediately obvious what the property might be used for. It reads well, but does not have an "ahha!" factor.<div>

<br></div><div style>connection.dbapi does.   I think it would be a good choice.  +1</div><div style>--</div><div style> Vernon Cole</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 2, 2013 at 6:16 AM, M.-A. Lemburg <span dir="ltr"><<a href="mailto:mal@egenix.com" target="_blank">mal@egenix.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 23.04.2013 16:41, Michael Bayer wrote:<br>
><br>
> On Apr 23, 2013, at 3:29 AM, M.-A. Lemburg <<a href="mailto:mal@egenix.com">mal@egenix.com</a>> wrote:<br>
><br>
>><br>
>><br>
>> A method doing the lookup via the sys.modules dictionary<br>
>> could resolve those issues:<br>
>><br>
>> database = connection.database()<br>
>> try:<br>
>>    cursor = connection.cursor()<br>
>>    cursor.execute(...)<br>
>> except database.DataError:<br>
>>    ...<br>
>><br>
>> Thoughts ?<br>
><br>
><br>
> we probably want to call it "module" or "namespace" or "api" or something like that.   The method itself can be a Python @property which would cause it to behave like an attribute in any case, or if we want to keep it as a method call to make it clear that code is being executed, that's fine as well.    But the spec would need to say in either case, "don't assign the module itself to the connection".<br>


<br>
</div>I like the idea with a property. I'm not sure about those other name<br>
candidates, though: "connection.database" make the code very<br>
readable, IMO.<br>
<br>
Is there a possible name clash with existing attributes on database<br>
modules that we would need to take into account ?<br>
<br>
Another readable candidate would be "connection.dbapi".<br>
<br>
--<br>
Marc-Andre Lemburg<br>
eGenix.com<br>
<br>
Professional Python Services directly from the Source  (#1, May 02 2013)<br>
<div class="im">>>> Python Projects, Consulting and Support ...   <a href="http://www.egenix.com/" target="_blank">http://www.egenix.com/</a><br>
>>> mxODBC.Zope/Plone.Database.Adapter ...       <a href="http://zope.egenix.com/" target="_blank">http://zope.egenix.com/</a><br>
>>> mxODBC, mxDateTime, mxTextTools ...        <a href="http://python.egenix.com/" target="_blank">http://python.egenix.com/</a><br>
________________________________________________________________________<br>
</div>2013-04-30: Released eGenix PyRun 1.2.0 ...       <a href="http://egenix.com/go44" target="_blank">http://egenix.com/go44</a><br>
<div class="im HOEnZb"><br>
::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::<br>
<br>
   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48<br>
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg<br>
           Registered at Amtsgericht Duesseldorf: HRB 46611<br>
               <a href="http://www.egenix.com/company/contact/" target="_blank">http://www.egenix.com/company/contact/</a><br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
DB-SIG maillist  -  <a href="mailto:DB-SIG@python.org">DB-SIG@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/db-sig" target="_blank">http://mail.python.org/mailman/listinfo/db-sig</a><br>
</div></div></blockquote></div><br></div>