[Python-ideas] Add new `Symbol` type

2018-07-05 Thread Flavio Curella
More than once I've found myself wanting to create a 'sentinel' value. The most common use case is to differentiate between an argument that has not been provided, and an argument provided with the value `None`. This would be solvable by implementing something similar to what JavaScript calls

Re: [Python-ideas] Add new `Symbol` type

2018-07-05 Thread Flavio Curella
> What functionality does such a thing actually need? I think the requirements should be: * The resulting symbol behave exactly like None. IE: the symbol should not be an instance of object, but an instance of its own class * A symbol can optionally be globally unique. * Two symbols created by

Re: [Python-ideas] Add new `Symbol` type

2018-07-06 Thread Flavio Curella
@Nathaniel Smith: > I think the name "symbol" here is pretty confusing. It comes originally from Lisp > The thing you're talking about is what Python devs call a "sentinel" object. Thank you for clarifying. I don't know much about Lisp, and I definitely appreciate the historical context that