Verifiably better, validated Enum for Python

Chris Angelico rosuav at gmail.com
Fri May 26 08:01:38 EDT 2017


On Fri, May 26, 2017 at 9:46 PM, Steve D'Aprano
<steve+python at pearwood.info> wrote:
>
>> And yes, Steve, this is a challenge to you: if you think C's undefined
>> behaviour is an abomination that should not be allowed to exist,
>
> CPython doesn't have to define the behaviour here. In *that* sense, the
> ordinary, regular sense, it is undefined. The implication of that is that
> whatever happens will happen according to some deterministic but
> unpredictable (to you, the developer, at least) chain of cause and effect
> that depends on the implementation. Probably something bad.
>
> That's fine. The Python language does not have to define the behaviour of
> programs which abuse ctypes like that. If you do so, then whatever happens
> will happen.
>
> That's not how the C standard defines "undefined behaviour", or the
> implication of such.

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.

ChrisA



More information about the Python-list mailing list