rogerbinns / apsw

Another Python SQLite wrapper
https://rogerbinns.github.io/apsw/
Other
733 stars 97 forks source link

Implement tp_str on APSW classes #494

Closed rogerbinns closed 10 months ago

rogerbinns commented 10 months ago

C implemented classes currently give the type and address only. We should be more helpful.

rogerbinns commented 10 months ago

After:

<apsw.Connection object "/tmp/testdb" at 0x7f30326bd6c0>
<apsw.Connection object "" at 0x7f303257c4f0>
<apsw.Connection object (closed) at 0x7f303257c5e0>
<apsw.Cursor object from <apsw.Connection object "/tmp/testdb" at 0x7f30326bd6c0> at 0x7f30326594e0>
<apsw.Cursor object from (closed) at 0x7f3031d3ba00>
<apsw.Cursor object from (closed) at 0x7f3032658ca0>
<apsw.zeroblob object size 3 at 0x7f3031da4330>
<apsw.Blob object from <apsw.Connection object "/tmp/testdb" at 0x7f30326bd6c0> at 0x7f3031d83570>
<apsw.Blob object from (closed) at 0x7f3031d83600>
<apsw.URIFilename object "/tmp/uri_test" at 0x7f3031da43b0>
<apsw.VFS object "aname" inherits from "unix" at 0x7f3031d836c0>
<apsw.VFSFile object filename "/tmp/testdb" at 0x7f3031d824c0>
<apsw.Backup object from <apsw.Connection object "/tmp/testdb" at 0x7f30326bd6c0> to <apsw.Connection object "" at 0x7f303257c4f0> at 0x7f303266ba30>
<apsw.Backup object from (closed) to (closed) at 0x7f303266bcf0>

Before:

<apsw.Connection object at 0x7ff6b83256c0>
<apsw.Connection object at 0x7ff6b81dc4f0>
<apsw.Connection object at 0x7ff6b81dc5e0>
<apsw.Cursor object at 0x7ff6b82c14e0>
<apsw.Cursor object at 0x7ff6b79a3a00>
<apsw.Cursor object at 0x7ff6b82c0ca0>
<apsw.zeroblob object at 0x7ff6b7a04330>
<apsw.Blob object at 0x7ff6b79e3570>
<apsw.Blob object at 0x7ff6b79e3600>
<apsw.URIFilename object at 0x7ff6b7a043b0>
<apsw.VFS object at 0x7ff6b79e36c0>
<apsw.VFSFile object at 0x7ff6b79e24c0>
<apsw.Backup object at 0x7ff6b852f770>
<apsw.Backup object at 0x7ff6b7ff1730>

Not updated are rarely used instances: