File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -248,9 +248,9 @@ quirks by using :func:`annotationlib.get_annotations` on Python 3.14+ or
248248:func: `inspect.get_annotations ` on Python 3.10+. On earlier versions of
249249Python, you can avoid these bugs by accessing the annotations from the
250250class's :attr: `~type.__dict__ `
251- (e.g. , ``cls.__dict__.get('__annotations__', None) ``).
251+ (for example , ``cls.__dict__.get('__annotations__', None) ``).
252252
253253In some versions of Python, instances of classes may have an ``__annotations__ ``
254- attribute. This is not supported functionality, so the best practice is to always
255- interact with the `` __annotations__ `` attribute of an instance's type. For example
256- `` type(myinstance).__annotations__ `` .
254+ attribute. However, this is not supported functionality. If you need the
255+ annotations of an instance, you can use :func: ` type ` to access its class
256+ (for example, `` annotationlib.get_annotations( type(myinstance)) `` on Python 3.14+) .
You can’t perform that action at this time.
0 commit comments