File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
285285context manager is meant to be subclassed, pick ` Optional[bool] ` .
286286See https://github.com/python/mypy/issues/7214 for more details.
287287
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+
288298NOTE: there are stubs in this repository that don't conform to the
289299style described above. Fixing them is a great starting point for new
290300contributors.
You can’t perform that action at this time.
0 commit comments