Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

find() variant returning a generator? #52

@janpascal

Description

@janpascal

Hi,

In my code I sometimes have to go thought all objects of a certain type. By using the DBObject.all() function it seems all objects are instantiated in a large array. Would it be possible to have all() or find() return a generator function, so that code like
for object in Object.all():
object.doSomething()
would involve only one instance of Object at a time, which could be garbage collected after each iteration in the loop?

Jan-Pascal

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions