[issue35123] Add style guide for sentinel usage

2018-11-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that there are not any problems that need solving. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker _

[issue35123] Add style guide for sentinel usage

2018-11-07 Thread Robert Wright
Robert Wright added the comment: Perhaps there's confusion over what I mean by "style guide". I'd happily take Steven's message *as* the style guide. Or, at the very least, the clarification that sentinels are to be thought of as constants. It's one of those things that's obvious once mentio

[issue35123] Add style guide for sentinel usage

2018-10-31 Thread Eric V. Smith
Eric V. Smith added the comment: I don't see any problems that need solving. My only interest in this is that I tend to think sentinels that are used for missing parameters should be exposed, and this isn't always an obvious consideration when designing an API. For example, say there's a li

[issue35123] Add style guide for sentinel usage

2018-10-31 Thread Steven D'Aprano
Steven D'Aprano added the comment: I was not aware that there currently were arguments about the use of sentinels in future code. I feel that you are being excessively prescriptive here: "we should nip it in the bud" is good advice for gardening, but for programming it just results in a lot

[issue35123] Add style guide for sentinel usage

2018-10-31 Thread STINNER Victor
STINNER Victor added the comment: Context: https://github.com/python/cpython/pull/8548#pullrequestreview-166711603 -- nosy: +vstinner ___ Python tracker ___ __

[issue35123] Add style guide for sentinel usage

2018-10-31 Thread Robert Wright
Robert Wright added the comment: Just the classic problems caused by inconsistency in code - confusion when reading, and disagreements when writing. For reading: Where should I look in a file for the sentinels? Is this value a sentinel, or is it some other type of variable? For writing, the

[issue35123] Add style guide for sentinel usage

2018-10-31 Thread Eric V. Smith
Eric V. Smith added the comment: Could you give some examples of problems caused by inconsistent usage of sentinels? I do often wish modules exposed their sentinel values, since it makes writing wrappers easier. It's one of the reasons I ended up exposing dataclasses.MISSING. -- no

[issue35123] Add style guide for sentinel usage

2018-10-31 Thread Robert Wright
New submission from Robert Wright : Sentinel values are used inconsistently in the Python code base. It would be helpful to have a style guide (about eg. casing, placement, and sentinel reuse) to prevent arguments about their use in future code. -- messages: 328984 nosy: madman bob pr