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

Vector.__reduce__: Do not invoke __new__ directly #157

Merged
merged 1 commit into from
May 24, 2019

Conversation

nbraud
Copy link
Collaborator

@nbraud nbraud commented May 24, 2019

This fixes a violation of the protocol for object construction:

If __new__ returns an instance of cls, then the new instance’s __init__() method will be invoked like __init__(self[, ...]), where self is the new instance and the remaining arguments are the same as were passed to __new__.

@astronouth7303 seems in agreement

This fixes a violation of the [protocol] for object construction:

> If __new__ returns an instance of cls, then the new instance’s __init__()
> method will be invoked like __init__(self[, ...]), where self is the new
> instance and the remaining arguments are the same as were passed to __new__.

[protocol]: https://docs.python.org/3/reference/datamodel.html#object.__new__
@AstraLuma
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request May 24, 2019
157: Vector.__reduce__: Do not invoke __new__ directly r=astronouth7303 a=nbraud

This fixes a violation of the [protocol] for object construction:

> If `__new__` returns an instance of `cls`, then the new instance’s `__init__()` method will be invoked like `__init__(self[, ...])`, where `self` is the new instance and the remaining arguments are the same as were passed to `__new__`.

[protocol]: https://docs.python.org/3/reference/datamodel.html#object.__new__

@astronouth7303 seems [in agreement](#146 (comment))

Co-authored-by: Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
@bors
Copy link
Contributor

bors bot commented May 24, 2019

Build succeeded

  • docs
  • FreeBSD PYTHON:3.6
  • FreeBSD PYTHON:3.7
  • lint
  • Linux python:3.6-slim
  • Linux python:3.7-slim
  • macOS PYTHON:3.6.8
  • macOS PYTHON:3.7.2
  • Windows python:3.6-windowsservercore-1809
  • Windows python:3.7-windowsservercore-1809

@bors bors bot merged commit 34b087c into ppb:master May 24, 2019
@nbraud nbraud deleted the pickle-ctor branch May 24, 2019 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants