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

Appearance settings

Remove a redundant comparison that raises an exception in Python 3 #2685

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

Merged
merged 1 commit into from
Dec 16, 2013

Conversation

mineo
Copy link
Contributor

@mineo mineo commented Dec 16, 2013

sphinx.version is a string, 1.1 is a float: the comparison always
returns True in Python 2. In Python 3 however the

<, <=, > and >= operators will raise a TypeError exception when
comparing a complex number with another built-in numeric type, when
the objects are of different types that cannot be compared, or in
other cases where there is no defined ordering

[0]. str and float are such unorderable types.

[0] http://docs.python.org/3.3/library/stdtypes.html#comparisons

sphinx.__version__ is a string, 1.1 is a float: the comparison always
returns True in Python 2. In Python 3 however the

> <, <=, > and >= operators will raise a TypeError exception when
> comparing a complex number with another built-in numeric type, when
> the objects are of different types that cannot be compared, or in
> other cases where there is no defined ordering

[0]. str and float are such unorderable types.

[0] http://docs.python.org/3.3/library/stdtypes.html#comparisons
@mdboom
Copy link
Member

mdboom commented Dec 16, 2013

Thanks. It's obsolete, anyway, so definitely makes sense to merge this.

@mdboom mdboom closed this Dec 16, 2013
@mdboom mdboom reopened this Dec 16, 2013
mdboom added a commit that referenced this pull request Dec 16, 2013
Remove a redundant comparison that raises an exception in Python 3
@mdboom mdboom merged commit b795756 into matplotlib:master Dec 16, 2013
mdboom added a commit that referenced this pull request Dec 16, 2013
Remove a redundant comparison that raises an exception in Python 3
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.