]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
dont use import * in any docs, ever
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 3 Jul 2022 15:01:25 +0000 (11:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 3 Jul 2022 15:02:25 +0000 (11:02 -0400)
(cherry picked from commit 9ab7b9a624cf5dfed93e0927eb4b3b62fe87e5ae)

doc/build/core/metadata.rst
doc/build/core/type_basics.rst

index 5c6fa2e5cbf8614d7b90ee5deba1ffe26a5b5b4e..d6a8f72dde1048cd17bdd305623382fa46f4e85a 100644 (file)
@@ -16,7 +16,7 @@ and :class:`_schema.MetaData` objects.
 A collection of metadata entities is stored in an object aptly named
 :class:`~sqlalchemy.schema.MetaData`::
 
-    from sqlalchemy import *
+    from sqlalchemy import MetaData
 
     metadata_obj = MetaData()
 
index 3ec50cc003917cfc4e930a2f263fb52f54a66ced..069214f99b99cef25f18d15ce9276bfdfa574c00 100644 (file)
@@ -209,17 +209,17 @@ Or some PostgreSQL types::
         Column('elements', postgresql.ARRAY(String))
     )
 
-Each dialect provides the full set of typenames supported by
-that backend within its `__all__` collection, so that a simple
-`import *` or similar will import all supported types as
-implemented for that backend::
+Each dialect provides the full set of database types supported by
+that backend within its own module, so they may all be used
+against the module directly without the need to differentiate between
+which types are specific to that backend or not::
 
-    from sqlalchemy.dialects.postgresql import *
+    from sqlalchemy.dialects import postgresql
 
     t = Table('mytable', metadata,
-               Column('id', INTEGER, primary_key=True),
-               Column('name', VARCHAR(300)),
-               Column('inetaddr', INET)
+               Column('id', postgresql.INTEGER, primary_key=True),
+               Column('name', postgresql.VARCHAR(300)),
+               Column('inetaddr', postgresql.INET)
     )
 
 Where above, the INTEGER and VARCHAR types are ultimately from