This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients eli.bendersky, flox, jcea, ncoghlan, python-dev, scoder
Date 2013-08-25.14:52:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAF-Rda9F7aC91mgapM6ZuQ+w+QhRDhTcFS9xj81-KX52xq79gw@mail.gmail.com>
In-reply-to <1377441949.33.0.412562110107.issue17741@psf.upfronthosting.co.za>
Content
> Stefan Behnel added the comment:
>
> > I still think IncrementalParser is worth keeping.
>
> If you want to keep it at all cost, I think we should at least hide it
> behind a function (as with iterparse()). If it's implemented as a class,
> chances are that people will start relying on internals by inheriting from
> it. And we already know that those internals should eventually be removed
> completely. Eventually, that function should become a two-liner or so.
>

I'm not sure I see how this is different from any class exposed by the
stdlib. Users can inherit it, rely on internals and then we can never
change its implementation? Surely this isn't true. We don't make guarantees
w.r.t. implementation and internals, only interfaces. Yes, Python lets you
monkey-patch anything, but this doesn't mean we can't build stable APIs in
Python and change implementation in the future.

So the only thing we should focus on is the *external* API of this class.
With only feed/close/events exposed, it seems logical that these can be
maintained even when the implementation changes.

Besides, such an incremental parser is a natural match for a class because
it has state and several methods that collectively act on that state.
Redesigning it as a function would be awkward. That said, if you have a
specific suggestion in mind that would be as natural to use in user code,
feel free to offer it.
History
Date User Action Args
2013-08-25 14:52:31eli.benderskysetrecipients: + eli.bendersky, jcea, ncoghlan, scoder, flox, python-dev
2013-08-25 14:52:31eli.benderskylinkissue17741 messages
2013-08-25 14:52:31eli.benderskycreate