spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Remove side effects from Doc.__init__()

Open richardpaulhudson opened this issue 2 years ago • 3 comments

Description

The existing version of Doc.__init__() changes sent_starts and ents lists passed as parameters. This PR removes these side effects.

Closes #11499.

Types of change

Bugfix

Checklist

  • [x] I confirm that I have the right to submit this contribution under the project's MIT license.
  • [x] I ran the tests, and all new and existing tests passed.
  • [x] My changes don't require a change to the documentation, or if they do, I've added all required information.

richardpaulhudson avatar Sep 15 '22 08:09 richardpaulhudson

Also update the types in doc.pyi?

adrianeboyd avatar Sep 15 '22 11:09 adrianeboyd

Oh yes, sorry, hadn't seen that!

richardpaulhudson avatar Sep 15 '22 17:09 richardpaulhudson

Looking good, I think the last thing that's missing is the corresponding update for the Doc API docs.

adrianeboyd avatar Sep 16 '22 12:09 adrianeboyd