Erik said:
Maybe it might be beneficial to learn a little more of the language
before proposing such wide-reaching (and un-Pythonic) reforms?
Hi Erik,
Getting more sleep is the answer to not making those kinds of oversights
in this case.
It's really was not a (my) proposal, but a suggestion someone else made.
It seemed like an interesting idea and I wanted to see what kind of
problems and benefits it would have. Discussing an idea with other
before it's fully thought out is a good way to explore its possibilities
even though it may mean appearing silly at times, which I don't mind.
In the previous posts I was attempting to show a possible pattern or
logic which doesn't currently correspond to the languages syntax using
parenthesis.
That's as close to an empty parenthesis as Python gets. I was really
trying to explain an underlying concept, not show actual python code.
And the conclusion (opinion) I've come to, is such a change might be
made to work, but it would be very confusing to most people who have
gotten use to the current None usage. And difficult to emplement in a
way that's consistant overall.
An alternative is to use a different word such as 'undefined'. Then
None can be used as it is currently, and undefined, can be used to test
for in a comparison for undefined names. Assigning a name to undefined
could be used as an alternative to delete a name but so far I don't see
an advantage to doing that way over using del.
if name is undefined: do something.
Instead of:
try:
name
except:
do something
And maybe:
name = undefined
can be used in expressions where del name can't?
But so far this doesn't seem useful enough to propose and it would
probably cause more problems (or confusion) than it solves.
Cheers,
Ron