[Bug 2130498] Re: range(3, 4) in range(1, 6) is valid but always returns False

Simon Lambourn 2130498 at bugs.launchpad.net
Tue Nov 4 16:20:46 UTC 2025


Hi Stefano,
   Thanks for your quick response.   I had read the documentation but now I have read it again, I realise that you are correct.   I see that Note 1 says that "some specialised sequences ... implement subsequence testing, such as "gg" in "eggs", and I guess that is what I'm looking for.

I will submit an upstream bug report as you suggest.  Thanks again.
Simon.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/2130498

Title:
  range(3,4) in range(1,6) is valid but always returns False

Status in python3-defaults package in Ubuntu:
  Invalid

Bug description:
  This came up as I was looking for overlapping ranges.

  The expression  range(3,4) in range(1,6)   is accepted as valid Python
  but always returns false.

  Expected behaviour:   either return True (in this example) or raise
  TypeError.

  ProblemType: Bug
  DistroRelease: Ubuntu 25.04
  Package: python3 3.13.3-1
  ProcVersionSignature: Ubuntu 6.14.0-35.35-generic 6.14.11
  Uname: Linux 6.14.0-35-generic x86_64
  ApportVersion: 2.32.0-0ubuntu5.3
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CurrentDesktop: ubuntu:GNOME
  Date: Sat Nov  1 16:54:02 2025
  SourcePackage: python3-defaults
  UpgradeStatus: Upgraded to plucky on 2025-06-11 (143 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/2130498/+subscriptions




More information about the foundations-bugs mailing list