MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _check_record_class

Function _check_record_class

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

Source from the content-addressed store, hash-verified

2799
2800
2801def _check_record_class(record_class):
2802 if record_class is protocol.Record:
2803 pass
2804 elif (
2805 isinstance(record_class, type)
2806 and issubclass(record_class, protocol.Record)
2807 ):
2808 if (
2809 record_class.__new__ is not protocol.Record.__new__
2810 or record_class.__init__ is not protocol.Record.__init__
2811 ):
2812 raise exceptions.InterfaceError(
2813 'record_class must not redefine __new__ or __init__'
2814 )
2815 else:
2816 raise exceptions.InterfaceError(
2817 'record_class is expected to be a subclass of '
2818 'asyncpg.Record, got {!r}'.format(record_class)
2819 )
2820
2821
2822def _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