这是indexloc提供的服务,不要输入任何密码
Skip to content

Batch: don't create new objects on getitem #1086

@MischaPanch

Description

@MischaPanch

Currently Batch.__getitem__ will always create a new object. This is counterintuitive and destroys equality checks. E.g.,

b = Batch(...)
id1 = id(b[0]) 
id2 = id(b[0])

will result in id1 != id2, which leads to b[0] == b[0] being False

Related to #922

Metadata

Metadata

Assignees

Labels

Batch and BufferImprovements in internal data structures, temporary labelbreaking changesChanges in public interfaces. Includes small changes or changes in keysrefactoringNo change to functionality

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions