Daniele Varrazzo wrote:
> Hello,
>
> in a discussion on the psycopg mailing list, an user has been
> surprised by the fact that .close() called on a closed connection
> raised error. I thought this was an implementation accident in the
> driver and a more robust semantics should allow for close to
On 19/10/11 09:59, M.-A. Lemburg wrote:
[snip]
>> risks to become a problem, with the close() that may raise an error
>> > because the connection has been implicitly closed by a communication
>> > error. Note that close() in itself often is a quite safe operation,
>> > not involving database commun
Federico Di Gregorio wrote:
> On 19/10/11 09:59, M.-A. Lemburg wrote:
> [snip]
>>> risks to become a problem, with the close() that may raise an error
because the connection has been implicitly closed by a communication
error. Note that close() in itself often is a quite safe operation,
>
On Wed, Oct 19, 2011 at 8:59 AM, M.-A. Lemburg wrote:
>> risks to become a problem, with the close() that may raise an error
>> because the connection has been implicitly closed by a communication
>> error. Note that close() in itself often is a quite safe operation,
>> not involving database com
Thinking about this some more ...
Perhaps what you're really after is the following and I was just
misunderstanding the original proposal:
class Connection:
closed = False
def close(self):
if self.closed:
return
# close the connection
...
self
On Wed, Oct 19, 2011 at 9:49 AM, M.-A. Lemburg wrote:
> Thinking about this some more ...
>
> Perhaps what you're really after is the following and I was just
> misunderstanding the original proposal:
>
> class Connection:
>
> closed = False
>
> def close(self):
> if self.closed:
>