-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Background
- These are some platform-dependent stubs
typeshed/stdlib/2/os/__init__.pyi
Lines 38 to 52 in fa74160
O_DSYNC: int # Unix only O_RSYNC: int # Unix only O_SYNC: int # Unix only O_NDELAY: int # Unix only O_NONBLOCK: int # Unix only O_NOCTTY: int # Unix only O_SHLOCK: int # Unix only O_EXLOCK: int # Unix only O_BINARY: int # Windows only O_NOINHERIT: int # Windows only O_SHORT_LIVED: int # Windows only O_TEMPORARY: int # Windows only O_RANDOM: int # Windows only O_SEQUENTIAL: int # Windows only O_TEXT: int # Windows only - Two different styles are used to write these stubs, and this difference is confusing for contributors
- Using comments like
# Windows onlyor# Unix only - Using
sys.platformliketypeshed/stdlib/2and3/time.pyi
Line 82 in fa74160
if sys.platform != 'win32':
- Using comments like
Proposal
- Decide a guideline on writing platform-dependent stubs
- Summarize it into the conventions section in
CONTRIBUTING.md - Update the existing stubs with the consistent style
Notes
- Based on this review Add nis stub #2213 (comment) by @gvanrossum, use of
sys.platformseems to be recommended now? - I'm interested in updating existing stubs after a guideline is decided
Metadata
Metadata
Assignees
Labels
No labels