Nick Coghlan added the comment:

Right, the request/requirement for in-place configuration changes arise from 
the fact the underlying buffer objects can't readily be shared, while makes 
swapping out the wrapper problematic if others may already have references to 
the original.

The "Don't do this implicitly in a library" admonition is then really the same 
one that applies to any unusual tinkering with global state (e.g. 
monkeypatching): you can definitely break things if you do it carelessly, so 
let the main application decide if and when global state updates are 
appropriate.


I do like "reconfigure()" as the API name, since that's then nicely amenable to 
expanding to all the settings supported by `open()` as concrete use cases 
arise. One thing we'll need to watch out for is the difference between "Leave 
this setting alone" and "Revert this setting to the global default".

----------

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

Reply via email to