]> 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:01:25 +0000 (11:01 -0400)
doc/build/core/metadata.rst
doc/build/core/type_basics.rst

index 97b30c4934a0beb51fcc212ecf4b820ec6dc4783..02c5b559a53abdece4af140c6667e76621ac8aac 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 21283ad7a651feb520c6640dce2eabfa24616938..be52f244dc23afd2a38180826368fe07241a5fde 100644 (file)
@@ -220,17 +220,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