Page MenuHomePhabricator

Comparison operators do not do identity check before comparing
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • pywikibot.WbTime(year=5) <= 5

What happens?: AttributeError: 'int' object has no attribute '_getSecondsAdjusted'

What should have happened instead?: TypeError: '<' not supported between instances of 'WbTime' and 'int'

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

RPI2026F1 changed the task status from Open to In Progress.Dec 23 2022, 2:02 AM
RPI2026F1 claimed this task.
RPI2026F1 triaged this task as High priority.

Change 871007 had a related patch set uploaded (by RPI2026F1; author: RPI2026F1):

[pywikibot/core@master] [Bugfix] Return NotImplemented when other is not WbTime

https://gerrit.wikimedia.org/r/871007

Change 871007 merged by jenkins-bot:

[pywikibot/core@master] [Bugfix] Return NotImplemented when other is not WbTime

https://gerrit.wikimedia.org/r/871007