Opened 4 years ago

Closed 4 years ago

#16691 closed Bug (duplicate)

Slicing none() incorrectly returns a list (expected EmptyQuerySet)

Reported by: raymond.penners@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I would expect the latter statement to return an (empty) QuerySet:

>>> type(User.objects.none())
<class 'django.db.models.query.EmptyQuerySet'>
>>> type(User.objects.all()[0:1])
<class 'django.db.models.query.QuerySet'>
>>> type(User.objects.none()[0:1])
<type 'list'>

Change History (1)

comment:1 Changed 4 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Dupe of #10139

Note: See TracTickets for help on using tickets.
Back to Top