MCPcopy
hub / github.com/MagicStack/asyncpg / _check_record_class

Function _check_record_class

asyncpg/connection.py:2746–2764  ·  view source on GitHub ↗
(record_class)

Source from the content-addressed store, hash-verified

2744
2745
2746def _check_record_class(record_class):
2747 if record_class is protocol.Record:
2748 pass
2749 elif (
2750 isinstance(record_class, type)
2751 and issubclass(record_class, protocol.Record)
2752 ):
2753 if (
2754 record_class.__new__ is not protocol.Record.__new__
2755 or record_class.__init__ is not protocol.Record.__init__
2756 ):
2757 raise exceptions.InterfaceError(
2758 'record_class must not redefine __new__ or __init__'
2759 )
2760 else:
2761 raise exceptions.InterfaceError(
2762 'record_class is expected to be a subclass of '
2763 'asyncpg.Record, got {!r}'.format(record_class)
2764 )
2765
2766
2767def _weak_maybe_gc_stmt(weak_ref, stmt):

Callers 2

_get_statementMethod · 0.85
connectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…