You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should stand out, glaringly, as a DRY failure. We are assigning a data descriptor object explicitly to handle strings, why must we declare, then, that instances contain strings within this attribute? The trivial example hides the scope of the majesty of this problem. A better example:
Ruh-roh! Requiring developers using Marrow Mongo to declare such a Union on every ObjectId field (even if abbreviated, e.g. through assignment of that Union to a variable) is a very bad idea. The descriptor itself knows what values it can handle, and what it will hand out. (Additionally, until lazy evaluation of annotations is more widespread, it'd be nice to not force those extra imports on people.)
Introduced in c2a4554 and patched in 98a0f5d to permit preservation of explicit annotations, remaining are tests and documentation.
The Attribute subclasses implementing fields may then declare an annotation attribute, which will be hoisted up into the containing class' __annotations__.
Trivial example:
This should stand out, glaringly, as a DRY failure. We are assigning a data descriptor object explicitly to handle strings, why must we declare, then, that instances contain strings within this attribute? The trivial example hides the scope of the majesty of this problem. A better example:
Ruh-roh! Requiring developers using Marrow Mongo to declare such a Union on every ObjectId field (even if abbreviated, e.g. through assignment of that Union to a variable) is a very bad idea. The descriptor itself knows what values it can handle, and what it will hand out. (Additionally, until lazy evaluation of annotations is more widespread, it'd be nice to not force those extra imports on people.)
Introduced in c2a4554 and patched in 98a0f5d to permit preservation of explicit annotations, remaining are tests and documentation.
The
Attribute
subclasses implementing fields may then declare anannotation
attribute, which will be hoisted up into the containing class'__annotations__
.MCVE. Demonstration of intent.
The text was updated successfully, but these errors were encountered: