You have a class called baseTest within a module called baseTest, so after importing the module baseTest, you would need to use baseTest.baseTest to access the class:

baseTest.baseTest.register(concreteTest)

Note that you don't even need to register concreteTest as a virtual subclass, since it's already an actual subclass. The register() method is meant to register classes that don't actually derive from an abstract class you defined, but do fulfill the interface.

That said, it is unlikely that you routinely want to use abstract classes in Python. They are useful in some special circumstances, but aren't used as the standard way of declaring interfaces. See also the blog post Python is not Java.

Answer from Sven Marnach on Stack Overflow
🌐
Python
docs.python.org › 3 › library › abc.html
abc — Abstract Base Classes
An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as “virtual subclasses” – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
🌐
GeeksforGeeks
geeksforgeeks.org › python › abstract-base-class-abc-in-python
Abstract Base Class (abc) in Python - GeeksforGeeks
July 15, 2025 - By using this register method, any abstract base class can become an ancestor of any arbitrary concrete class. Let's understand this process by considering an example of an abstract base class that registers itself as an ancestor of dict.
🌐
GitHub
github.com › python › cpython › blob › main › Lib › abc.py
cpython/Lib/abc.py at main · python/cpython
Use this metaclass to create an ABC. An ABC can be subclassed · directly, and then acts as a mix-in class. You can also register · unrelated concrete classes (even built-in classes) and unrelated · ABCs as 'virtual ...
Author   python
🌐
Python Module of the Week
pymotw.com › 2 › abc
abc – Abstract Base Classes - Python Module of the Week
In this example the PluginImplementation is not derived from PluginBase, but is registered as implementing the PluginBase API. $ python abc_register.py Subclass: True Instance: True
🌐
Python
peps.python.org › pep-3119
PEP 3119 – Introducing Abstract Base Classes | peps.python.org
The ABCMeta class overrides __instancecheck__ and __subclasscheck__ and defines a register method. The register method takes one argument, which must be a class; after the call B.register(C), the call issubclass(C, B) will return True, by virtue ...
🌐
Python.org
discuss.python.org › ideas
List all registered classes from `abc.ABC.register` - Ideas - Discussions on Python.org
September 28, 2022 - Currently, as far as I know, there’s no way to recover the registered subclasses of abc.ABC (through cls.register(MyClass)) class A: pass class Array(abc.ABC): pass Array.register(A) # How to recover A from Array after this call ? assert isinstance(A(), Array) abc.get_registered(Array) # == [A] #
🌐
Python
docs.python.org › 3 › library › collections.abc.html
collections.abc — Abstract Base Classes for Containers
ABC for classes that provide the __iter__() method. Checking isinstance(obj, Iterable) detects classes that are registered as Iterable or that have an __iter__() method, but it does not detect classes that iterate with the __getitem__() method.
Find elsewhere
🌐
W3Schools
w3schools.com › python › ref_module_abc.asp
Python abc Module
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... from abc import ABC, abstractmethod class Shape(ABC): @abstractmethod def area(self): pass class Square(Shape): def __init__(self, s): self.s = s def area(self): return self.s * self.s sq = Square(3) print(isinstance(sq, Shape)) print(sq.area()) Try it Yourself »
🌐
Medium
medium.com › analytics-vidhya › abc-in-python-abstract-base-class-35808a9d6b32
ABC in Python (Abstract Base Class) | by nijanthan | Analytics Vidhya | Medium
March 12, 2024 - Note: The type of ABC ( type(ABC) ... may lead to metaclass conflicts. register(): We can make a concrete subclass or built-in subclass as a virtual subclass using the register....
🌐
Readthedocs
docspy3zh.readthedocs.io › en › latest › library › abc.html
27.7. abc — Abstract Base Classes — Python 3 文档(简体中文) 3.2.2 documentation
An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as “virtual subclasses” – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
🌐
Medium
elfi-y.medium.com › inheritance-in-python-with-abstract-base-class-abc-5e3b8e910e5e
Inheritance in Python with Abstract Base Class(ABC) | by E.Y. | Medium
January 13, 2021 - This method is one step further to register , as it defines whether the registered subclass is considered a subclass of this ABC. So you can customise the behaviour of issubclass without the need to call register() on every subclass. The important bit here is that it’s defined as classmethod on the class and it's called by abc.ABC.__subclasscheck__.
🌐
Readthedocs
python-can.readthedocs.io › en › 3.1.1 › _modules › abc.html
abc — python-can 3.1.0 documentation
""" def __new__(mcls, name, bases, namespace, **kwargs): cls = super().__new__(mcls, name, bases, namespace, **kwargs) _abc_init(cls) return cls def register(cls, subclass): """Register a virtual subclass of an ABC. Returns the subclass, to allow usage as a class decorator.
🌐
Python Course
python-course.eu › oop › the-abc-of-abstract-base-classes.php
20. The 'ABC' of Abstract Base Classes | OOP | python-course.eu
from abc import ABC, abstractmethod class AbstractClassExample(ABC): def __init__(self, value): self.value = value super().__init__() @abstractmethod def do_something(self): pass
🌐
Python Module of the Week
pymotw.com › 3 › abc › index.html
abc — Abstract Base Classes
$ python3 abc_abc_base.py Subclass: True Instance: True · Another benefit of subclassing directly from the abstract base class is that the subclass cannot be instantiated unless it fully implements the abstract portion of the API. ... import abc from abc_base import PluginBase @PluginBase.register class IncompleteImplementation(PluginBase): def save(self, output, data): return output.write(data) if __name__ == '__main__': print('Subclass:', issubclass(IncompleteImplementation, PluginBase)) print('Instance:', isinstance(IncompleteImplementation(), PluginBase))
🌐
Python
docs.python.org › 3.8 › library › abc.html
abc — Abstract Base Classes — Python 3.8.20 documentation
An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as “virtual subclasses” – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
🌐
Python
docs.python.org › 3.10 › library › abc.html
abc — Abstract Base Classes — Python 3.10.18 documentation
An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as “virtual subclasses” – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
🌐
Machine Learning Plus
machinelearningplus.com › python › python-abcs-the-complete-guide-to-abstract-base-classes
Python ABCs- The Complete Guide to Abstract Base Classes – Machine Learning Plus
Let’s create a Printer abstract base class with a print_document() method, then create classes that we’ll register as virtual subclasses. ... class Printer(ABC): @abstractmethod def print_document(self, document): pass # Different printer classes (imagine they're from different libraries) class LaserPrinter: def print_document(self, document): return f"Laser printer: {document}" class InkjetPrinter: def print_document(self, document): return f"Inkjet printer: {document}" # Register classes as virtual subclasses Printer.register(LaserPrinter) Printer.register(InkjetPrinter) # Now we can check if they're subclasses laser = LaserPrinter() inkjet = InkjetPrinter() print(f"Is LaserPrinter a subclass of Printer?
🌐
GitHub
github.com › python › mypy › issues › 2922
ABCMeta.register support · Issue #2922 · python/mypy
September 7, 2016 - class A(metaclass=abc.ABCMeta): pass class B: pass A.register(B) a: A = B() # currently E: Incompatible types in assignment (expression has type "B", variable has type "A") print(isinstance(a, A)) # -> True Mypy could support cases like ...
Author   miedzinski