Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected __init__ call for SyntaxCorpusReader subclasses #2872

Merged
merged 1 commit into from Nov 4, 2021

Conversation

tomaarsen
Copy link
Member

@tomaarsen tomaarsen commented Oct 27, 2021

Resolves #2118

Hello!

Pull request overview

  • Replaced CorpusReader.__init__(...) with SyntaxCorpusReader.__init__(...) on classes that inherit from SyntaxCorpusReader.

Details

See #2118 for details on the issue.

Beyond that:

>>> 
>>> from nltk.corpus import CorpusReader, SyntaxCorpusReader
>>> CorpusReader.__init__ == SyntaxCorpusReader.__init__
True

SyntaxCorpusReader inherits from CorpusReader, and the former doesn't specify a __init__, so both methods are identical. That means, we can just go for the logical option of calling __init__ on the parent we are actually inheriting from.

  • Tom Aarsen

CorpusReader.__init__ == SyntaxCorpusReader.__init__

Resolves nltk#2118
@stevenbird stevenbird merged commit bf9813d into nltk:develop Nov 4, 2021
16 checks passed
@tomaarsen tomaarsen deleted the enhancement/corpus-reader-init branch Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants