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

Comparison operators - New rules undocumented in Python 3.0 #48053

Closed
mgiuca mannequin opened this issue Sep 8, 2008 · 2 comments
Closed

Comparison operators - New rules undocumented in Python 3.0 #48053

mgiuca mannequin opened this issue Sep 8, 2008 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@mgiuca
Copy link
Mannequin

mgiuca mannequin commented Sep 8, 2008

BPO 3803
Nosy @birkenfeld
Files
  • expressions.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/birkenfeld'
    closed_at = <Date 2008-09-09.19:32:18.955>
    created_at = <Date 2008-09-08.06:49:30.217>
    labels = ['docs']
    title = 'Comparison operators - New rules undocumented in Python 3.0'
    updated_at = <Date 2008-09-09.19:32:18.954>
    user = 'https://bugs.python.org/mgiuca'

    bugs.python.org fields:

    activity = <Date 2008-09-09.19:32:18.954>
    actor = 'georg.brandl'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2008-09-09.19:32:18.955>
    closer = 'georg.brandl'
    components = ['Documentation']
    creation = <Date 2008-09-08.06:49:30.217>
    creator = 'mgiuca'
    dependencies = []
    files = ['11421']
    hgrepos = []
    issue_num = 3803
    keywords = ['patch']
    message_count = 2.0
    messages = ['72767', '72900']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'mgiuca']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3803'
    versions = ['Python 3.0']

    @mgiuca
    Copy link
    Mannequin Author

    mgiuca mannequin commented Sep 8, 2008

    I've noticed that in Python 3.0, the <, >, <= and >= operators now raise
    a TypeError when comparing objects of different types, rather than
    ordering them "consistently but arbitrarily". The documentation doesn't
    yet reflect this behaviour.

    The current documentation says:
    "(This unusual definition of comparison was used to simplify the
    definition of operations like sorting and the in and not in operators.
    In the future, the comparison rules for objects of different types are
    likely to change.)"

    I assume this is the change it's warning us about.

    Hence I propose this patch to reference/expressions.rst, which removes
    the above quoted paragraph and describes the new TypeError-raising
    behaviour. My text is as follows:

    "The objects need not have the same type. If both are numbers, they are
    converted to a common type. Otherwise, the == and != operators always
    consider objects of different types to be unequal, while the <, >, >=
    and <= operators raise a TypeError when comparing objects of different
    types."

    @mgiuca mgiuca mannequin assigned birkenfeld Sep 8, 2008
    @mgiuca mgiuca mannequin added the docs Documentation in the Doc dir label Sep 8, 2008
    @birkenfeld
    Copy link
    Member

    Thanks, fixed in r66349.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant