Verifiably better, validated Enum for Python

Rustom Mody rustompmody at gmail.com
Fri May 26 10:09:33 EDT 2017


On Friday, May 26, 2017 at 7:11:50 PM UTC+5:30, Chris Angelico wrote:
> On Fri, May 26, 2017 at 10:52 PM, Rustom Mody  wrote:
> >> Can you explain to me how it's different? Either way, the
> >> implementation is allowed to do what it likes, because you shouldn't
> >> be doing that.
> >
> > I am guessing that Steven is mixing up undefined and unspecified behavior
> >
> > Undefined : Implementation can do whatever it likes; erroring out or not
> > Unspecified :
> > | use of an unspecified value, or other behavior where this International Standard
> > | provides two or more possibilities and imposes no further requirements on which
> > | is chosen in any instance
> 
> Which of these terms applies to each situation?

Not sure which 'each situation' is referring to
As far as mutating string constants, my impression is that this is 
undefined behavior

So 
- Compiler/runtime giving an error
- No error and silently changing
- No error no change
- Decide which of above by phase of the moon

All these are valid behavior (for a compliant compiler)

Strictly speaking invoking undefined behavior allows the implementation to "rm /" or whatever



More information about the Python-list mailing list