-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Mark base node classes as ABCs #11676
Copy link
Copy link
Closed
Labels
topic: collectionrelated to the collection phaserelated to the collection phasetopic: typingtype-annotation issuetype-annotation issuetype: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelogmight present some backward compatibility issues which should be carefully noted in the changelogtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Metadata
Metadata
Assignees
Labels
topic: collectionrelated to the collection phaserelated to the collection phasetopic: typingtype-annotation issuetype-annotation issuetype: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelogmight present some backward compatibility issues which should be carefully noted in the changelogtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
The Node class hierarchy has some classes which are only meant to be used as base classes, never instantiated directly. These are
Node,Collector,Item,File,FSCollector,PyCollector.I propose we mark them as abstract i.e. inherit from
abc.ABC. Reasons:abstractmethodon the abstract methods that need to be implemented (collectorruntest), and show inheritance fromABCmaking it clear it's a base classIt seems somewhat hard to deprecate, and it will only cause errors when the code is already very wrong. So I propose to do it in pytest 8.0 without deprecation.