]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- add a note as to why we have this very complicated Annotated
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Mar 2017 22:38:21 +0000 (17:38 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Mar 2017 22:38:21 +0000 (17:38 -0500)
system

Change-Id: I7d4048b92fcd3a7c7630c43aa9390d983f447c0a

lib/sqlalchemy/sql/annotation.py

index 834c93912ffc9a193520a4397d92a8ef42b7d7ec..e6f6311c48bc921b04a59bfaedb9139a38989f39 100644 (file)
@@ -26,6 +26,13 @@ class Annotated(object):
     reason of keeping its hash value current.  When GC'ed, the
     hash value may be reused, causing conflicts.
 
+    .. note::  The rationale for Annotated producing a brand new class,
+       rather than placing the functionality directly within ClauseElement,
+       is **performance**.  The __hash__() method is absent on plain
+       ClauseElement which leads to significantly reduced function call
+       overhead, as the use of sets and dictionaries against ClauseElement
+       objects is prevalent, but most are not "annotated".
+
     """
 
     def __new__(cls, *args):