File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,16 @@ are not sure whether exceptions are suppressed or not or if the
285
285
context manager is meant to be subclassed, pick ` Optional[bool] ` .
286
286
See https://github.com/python/mypy/issues/7214 for more details.
287
287
288
+ A few guidelines for protocol names below. In cases that don't fall
289
+ into any of those categories, use your best judgement.
290
+
291
+ * Use plain names for protocols that represent a clear concept
292
+ (e.g. ` Iterator ` , ` Container ` ).
293
+ * Use ` SupportsX ` for protocols that provide callable methods (e.g.
294
+ ` SupportsInt ` , ` SupportsRead ` , ` SupportsReadSeek ` ).
295
+ * Use ` HasX ` for protocols that have readable and/or writable attributes
296
+ or getter/setter methods (e.g. ` HasItems ` , ` HasFileno ` ).
297
+
288
298
NOTE: there are stubs in this repository that don't conform to the
289
299
style described above. Fixing them is a great starting point for new
290
300
contributors.
You can’t perform that action at this time.
0 commit comments