Message198202
| Author |
eli.bendersky |
| Recipients |
eli.bendersky, ncoghlan, scoder, serhiy.storchaka |
| Date |
2013年09月21日.14:05:28 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CAF-Rda_08k0F7GuTiC=sZg7ubJ3MYbg_HR2KM7uKV6q90CZO7w@mail.gmail.com> |
| In-reply-to |
<CADiSq7ffCjVLc-qznTa=E3oCGeEBLTfBusTP1hthTpv_PmWAaA@mail.gmail.com> |
| Content |
On Sat, Sep 21, 2013 at 5:52 AM, Nick Coghlan <report@bugs.python.org>wrote:
>
> Nick Coghlan added the comment:
>
> Actually, I think it's reasonable to define the custom target nominally
> abstracted by PullParser as always returning None from close(). As Eli
> notes, it's designed to let you discard events as you go, so remembering
> them internally to return from close() doesn't make sense.
>
IMHO the documentation is already sufficient w.r.t. this. By convention,
when a method does not return anything, we just don't mention its return
value. So:
close()
Signal the parser that the data stream is terminated.
Seems good.
> That means the patch could be simplified to just removing the root
> attribute without changing the result of calling close().
>
Unfortunately I don't have time to review refactoring patches now. In light
of a larger refactoring planned in this part of the module in the future, I
don't think it's very important to tweak things right now. |
|