3 ms·
Yes, where would I be without the _RelationshipBackPopulatesArgument type of sqlalchemy.orm.relationship(argument: _RelationshipArgumentType[Any] | Non
by eloisius 4mo ago
Yes, where would I be without the _RelationshipBackPopulatesArgument type of
sqlalchemy.orm.relationship(argument: _RelationshipArgumentType[Any] | None = None, secondary: _RelationshipSecondaryArgument | None = None, *, uselist: bool | None = None, collection_class: Type[Collection[Any]] | Callable[[], Collection[Any]] | None = None, primaryjoin: _RelationshipJoinConditionArgument | None = None, secondaryjoin: _RelationshipJoinConditionArgument | None = None, back_populates: _RelationshipBackPopulatesArgument | None = None, order_by: _ORMOrderByArgument = False, backref: ORMBackrefArgument | None = None, overlaps: str | None = None, post_update: bool = False, cascade: str = 'save-update, merge', viewonly: bool = False, init: _NoArg | bool = _NoArg.NO_ARG, repr: _NoArg | bool = _NoArg.NO_ARG, default: _NoArg | _T = _NoArg.NO_ARG, default_factory: _NoArg | Callable[[], _T] = _NoArg.NO_ARG, compare: _NoArg | bool = _NoArg.NO_ARG, kw_only: _NoArg | bool = _NoArg.NO_ARG, hash: _NoArg | bool | None = _NoArg.NO_ARG, lazy: _LazyLoadArgumentType = 'select', passive_deletes: Literal['all'] | bool = False, passive_updates: bool = True, active_history: bool = False, enable_typechecks: bool = True, foreign_keys: _ORMColCollectionArgument | None = None, remote_side: _ORMColCollectionArgument | None = None, join_depth: int | None = None, comparator_factory: Type[RelationshipProperty.Comparator[Any]] | None = None, single_parent: bool = False, innerjoin: bool = False, distinct_target_key: bool | None = None, load_on_pending: bool = False, query_class: Type[Query[Any]] | None = None, info: _InfoType | None = None, omit_join: Literal[None, False] = None, sync_backref: bool | None = None, dataclass_metadata: _NoArg | Mapping[Any, Any] | None = _NoArg.NO_ARG, \*kw: Any) → _RelationshipDeclared[Any]*
- strbean 4mo ago_RelationshipBackPopulatesArgument = Union[ str, PropComparator[Any], Callable[[], Union[str, PropComparator[Any]]], ]
- cogman10 4mo agoIt's not for you, it's for your IDE. And if you aren't using an IDE then you can pretty much ignore it anyways. You are in exactly the same position as if you knew or didn't know that type.
- nonethewiser 4mo agoIf you're not using and IDE nor an LLM
- zephen 4mo ago[flagged]
- deleted 4mo ago[deleted]
- chuckadams 4mo agoPart of it is due to the clunky `_NoArg.NO_ARG` business for optional params. Pretty-printing it would also go a long way, but that technology seems too advanced for any language circa 2026.
- cik 4mo agoThis is a big part of the reason that I've embraced ths sqlc (d/re)evolution. Writing queries in sql and then generating for the target language also provides a flexibility that has reduced rewrite cost. Add to this ease of organization and layoit, and I'm not going back.
- tlavoie 4mo agoIt's probably hard to come up with something messier than SqlAlchemy here. Not an expert, but spent more than enough time spelunking queries in the debugger. I much prefer bugs that can be surfaced at compile-time rather than run-time.
- Ardren 4mo agoWhat function signature isn't going to look messy with 36 keyword arguments. https://github.com/sqlalchemy/sqlalchemy/blob/0798e6cbe11b302c86dedff3d8e75eeb8ae045be/lib/sqlalchemy/orm/relationships.py#L404 https://github.com/sqlalchemy/sqlalchemy/blob/0798e6cbe11b30...
- AdieuToLogic 4mo ago>> I think types are particularly valuable for libraries. > Yes, where would I be without the _RelationshipBackPopulatesArgument type of ... (proceeds to list a signature with over 40 parameters) You would be left wondering which of the 40+ arguments provided to a given invocation is not what was allowed without a compiler to tell you. Have fun tracking down which one, or ones, is causing the problem.