Type hints for result objects from orm select

218 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Rohit Krishnamoorthy

ungelesen,
04.04.2022, 02:02:5804.04.22
an sqlalchemy
How to do types hints for result of select statement
can i use the orm class of the table itself as type for return value

Mike Bayer

ungelesen,
04.04.2022, 09:46:2004.04.22
an noreply-spamdigest via sqlalchemy
We dont have a system for per-column type hinting right now.    pep-484 and related peps unfortunately do not support effective means of representing custom tuple-like structures.   The closest they have is pep-646, but unfortunately this pep does not provide enough functionality for database tools and ORMs to be able to make use of it in order to type database rows generically.



On Mon, Apr 4, 2022, at 2:02 AM, Rohit Krishnamoorthy wrote:
How to do types hints for result of select statement
can i use the orm class of the table itself as type for return value


--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
 
 
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten