New submission from Raymond Hettinger:

It is really nice to have the open/closed status in the __repr__ of file 
objects: 

  <open file 'data.txt', mode 'r' at 0x102c8ec90>
  <closed file 'data.txt', mode 'r' at 0x102c8ec90>

I would like to have the same for locks:

  <unlocked thread.lock object at 0x1002b1330>
  <locked thread.lock object at 0x1002b1330>

This would be nice in logs and tracebacks for example.

----------
components: Library (Lib)
keywords: easy
messages: 215413
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Better repr for threading.Lock()
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21137>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to