Skip to content

[prerelease] Removed instance attribute on Module / Class  #9486

Closed
@The-Compiler

Description

@The-Compiler

Yet another subtle API break I discovered in 7.0.0 (sorry...):

Before #9277, Module and Class nodes had a instance attribute from PyobjMixin (via PyCollector). With that change, that attribute now is only available on Function nodes.

This affected pytest-randomly - I don't see a good way to find out how much more it affects (can't really search for .instance, and there are lots of ways to get to those nodes).

I doubt it will affect much more, but we should either re-add the attribute (probably just set to None plus a deprecation warning?), or if we decide to remove it without a deprecation (fine by me), at least document the removal as usual.

cc @bluetech

Metadata

Metadata

Assignees

Labels

topic: collectionrelated to the collection phasetype: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelog

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions