diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-03-09 17:38:21 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-03-09 17:38:21 -0500 |
commit | 75ceae6ea6493d44d616df1f21d180b3e7a2e8f5 (patch) | |
tree | 94f8e1460f32556bd034714d48d06bfe98702b4f /lib/sqlalchemy/sql | |
parent | c04870ba7b8098c7d408ad66f60efe7229496fde (diff) | |
download | sqlalchemy-75ceae6ea6493d44d616df1f21d180b3e7a2e8f5.tar.gz |
- add a note as to why we have this very complicated Annotated
system
Change-Id: I7d4048b92fcd3a7c7630c43aa9390d983f447c0a
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r-- | lib/sqlalchemy/sql/annotation.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py index 834c93912..e6f6311c4 100644 --- a/lib/sqlalchemy/sql/annotation.py +++ b/lib/sqlalchemy/sql/annotation.py @@ -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): |