Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix % formatting and Transform equality.#8399

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

anntzer
Copy link
Contributor

Use.format(key) instead of% key formatting which fails whenkey
is a tuple (one could also use% (key,) but we may as well use the
more modern option).

TheTransform class doesn't need to override__eq__ as user-defined
classes default to using identity for equality. This also avoids having
to add a__hash__ to these classes to make them hashable (by default,
user-defined classes are hashable, but become unhashable (in Py3) if
they define a__eq__ without defining a__hash__). A more complete
PR should define__hash__ for allTransform subclasses too.


Partial fix for#8395 (a full fix needs to restore hashability of most Transform subclasses).

Use `.format(key)` instead of `% key` formatting which fails when `key`is a tuple (one could also use `% (key,)` but we may as well use themore modern option).The `Transform` class doesn't need to override `__eq__` as user-definedclasses default to using identity for equality.  This also avoids havingto add a `__hash__` to these classes to make them hashable (by default,user-defined classes are hashable, but become unhashable (in Py3) ifthey define a `__eq__` without defining a `__hash__`).  A more completePR should define `__hash__` for all `Transform` subclasses too.
Copy link
Member

@phobsonphobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@phobsonphobson modified the milestone:2.1 (next point release)Mar 31, 2017
@dstansbydstansby merged commit877636d intomatplotlib:masterApr 12, 2017
@anntzeranntzer deleted the fix-axesstack-formatting-transforms-eq branchApril 12, 2017 16:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@phobsonphobsonphobson approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.1
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@phobson@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp