MCPcopy
hub / github.com/pallets-eco/flask-sqlalchemy / __new__

Method __new__

src/flask_sqlalchemy/extension.py:490–499  ·  view source on GitHub ↗
(
                cls, *args: t.Any, bind_key: str | None = None, **kwargs: t.Any
            )

Source from the content-addressed store, hash-verified

488
489 class Table(_Table):
490 def __new__(
491 cls, *args: t.Any, bind_key: str | None = None, **kwargs: t.Any
492 ) -> Table:
493 # If a metadata arg is passed, go directly to the base Table. Also do
494 # this for no args so the correct error is shown.
495 if not args or (len(args) >= 2 and isinstance(args[1], sa.MetaData)):
496 return super().__new__(cls, *args, **kwargs)
497
498 metadata = self._make_metadata(bind_key)
499 return super().__new__(cls, *[args[0], metadata, *args[1:]], **kwargs)
500
501 return Table
502

Callers

nothing calls this directly

Calls 1

_make_metadataMethod · 0.80

Tested by

no test coverage detected