Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:

Would it make sense to convert _field_types to a property, so the method(s) 
that implement the property can do:

warnings.warn("_field_types is deprecated; use __annotations__ instead", 
DeprecationWarning)

to indicate the deprecation programmatically, not just in the documentation? 
The property could be backed by __annotations__ directly; they're already 
aliases of one another, so the only difference in behavior would be if someone 
was actually reassigning _field_types after class definition time (which I'm 
hoping is an invalid use case...). Would save some headaches for folks who run 
with warnings enabled, but don't read the What's New notices in detail.

----------
nosy: +josh.r

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36320>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to