-
Notifications
You must be signed in to change notification settings - Fork 39
Add arbitrary io buffer support to reader #234
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
Conversation
I will fix the import order for the test file, on the complexity of the init function it would help to get some maintainer input before proceeding, disabling/increasing the value is not something I feel comfortable making a decision on for a driveby pr. Edit: nvm I can just reduce the complexity ig |
4e4fb20
to
5ce419e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you! I have one comment.
maxminddb/reader.py
Outdated
def _load_buffer( | ||
self, database: AnyStr | int | PathLike | IO, mode: int = MODE_AUTO | ||
) -> None: | ||
self.filename: Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than making this a public attribute, what do you think about returning it from this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for me, changed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
This PR closes #232
Went with the suggested method of defaulting the filename to f"< type >" if it doesn't exist. The test has to work around the workaround which is used to avoid having to open files manually, I added a comment on it to explain why it is needed.