Message294933
| Author |
pitrou |
| Recipients |
benjamin.peterson, ncoghlan, pitrou, serhiy.storchaka, stutzbach |
| Date |
2017年06月01日.10:43:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<88b51359-9d27-ac1f-e380-091842791186@free.fr> |
| In-reply-to |
<1496313690.08.0.285440562054.issue30526@psf.upfronthosting.co.za> |
| Content |
Le 01/06/2017 à 12:41, Serhiy Storchaka a écrit :
>
> First at all, I'm not sure that allowing to modify TextIOWrapper settings after creation is a good idea. I would be feeling uncomfortable if the third-party library changed the buffering or encoding settings of passed text stream for its own needs, and this stream is sys.stdout.
Agreed that third-party libraries should not, but we're talking about
applications here.
> For example set f.line_buffering = False for performance and break your logging. Creating a new TextIOWrapper for own needs looks safer.
Now you may have two TextIOWrappers alive wrapping the same buffered IO
object. |
|