Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Score of 2
1 answer
102 views

I'm currently using ABC's to ensure that my child classes implement a specific method (or property, in this particular case). I want to make it impossible to create children of Entity without ...
Score of 1
1 answer
141 views

This question is related to a question about the implementation of class property in Python which I have asked yesterday. I received a working solution and wrote my classProp and ClassPropMeta as the ...
Score of 0
1 answer
79 views

In the following code, PyCharm is issuing a typing warning for Base.foo ("Expected to return 'int', got no return") but not for Base.bar, which has exactly the same typing hint and return ...
Score of 0
1 answer
115 views

I'm implementing a repository pattern as an excercise on typing. I have a couple of unrelated SQLAlchemy models: class Base(MappedAsDataclass, DeclarativeBase): id: Mapped[primary_key] = ...
Score of 0
0 answers
161 views

While studying the source code of the numbers.py module from build-in lib, I came across two variants of @abstractmethod (with and without the NotImplementedError raise). Example: class Complex(ABC): ...
Score of 0
1 answer
84 views

I have a set of plugins that inherit from a metaclass. the metaclasss is defined like so: from abc import ABC, abstractmethod class MetaReader(ABC): def __init__(self, arg1, arg2, **kwargs): ...
Score of 0
0 answers
22 views

I have python models which are created using a particular version of my module repository. As updates and changes are made to the repo, the models are not always backward compatible. I'm wondering if ...
Score of 1
1 answer
88 views

I was reading PEP-3119, and I discovered that builtins derive from ABCs. From PEP-3119: The built-in type set derives from MutableSet. The built-in type frozenset derives from Set and Hashable. In ...
Score of 1
1 answer
141 views

I'm trying to figure out in python whether virtual subclass will pass the static type check like mypy. And I read about this in fluent python: Virtual subclasses do not inherit from their registered ...
Score of 0
1 answer
141 views

I'm trying to combine a class implementing an abc interface with another class. Let's start with abc simple example: import abc class Interface(abc.ABC): @abc.abstractmethod def ...
Score of 0
1 answer
205 views

As you can see in the picture below, coverage wants me to write a test case for the method inside the abc. But I dont know how to do it, I mean as far as I can see there is nothing to test. Code: ...
Score of 0
0 answers
140 views

I have a regular class inheriting from a frozen dataclass. The attributes in my regular class are marked as 'read-only'. Which I understand due to inheriting the characteristics of the frozen ...
Score of -1
1 answer
405 views

starting from a few days ago every time I try downloading any packages to my environment (or pip installing directly through the terminal) and/or delete/uninstall an existing package in my envirinemt, ...
Score of 0
0 answers
109 views

I have an object that inherits both from a QWidget and an abc.ABC interface. See MyWindow in my example below. import abc from PySide6 import QtCore, QtWidgets #from PyQt6 import QtCore, QtWidgets #...
Score of 1
1 answer
1762 views

I'm not too familiar with the use of abstract classes, so I'm trying to understand what is happening in some code I'm using at the moment. In the code, I have a base dataset class, and some ...

15 30 50 per page
1
2 3 4 5
19