(original) (raw)



On 25 September 2016 at 21:18, Guido van Rossum <guido@python.org> wrote:
Be careful though, comparing these to plain integers should probably
be allowed,

​There's a good reason why it's "opaque" ... why would you want to make it less opaque?

And I'm curious why Python didn't adopt the fgetpos/fsetpos style that makes the data structure completely opaque (fpos\_t). IIRC, this was added to C when the ANSI standard was first written, to allow cross-platform compatibility in cases where ftell/fseek was difficult (or impossible) to fully implement. Maybe those reasons don't matter any more (e.g., dealing with record-oriented or keyed file systems) ...

and we also should make sure that things like
serialization via JSON or storing in an SQL database don't break. I
personally think it's one of those "learn not to touch the stove"
cases and there's limited value in making this API idiot proof.

On Sun, Sep 25, 2016 at 9:05 PM, Nick Coghlan <ncoghlan@gmail.com> wrote:
\> On 26 September 2016 at 10:21, MRAB <python@mrabarnett.plus.com> wrote:
\>> On 2016-09-26 00:21, Ben Leslie wrote:
\>>> Are there any downsides to this? I've made some progress developing a
\>>> patch to change this functionality. Is it worth polishing and
\>>> submitting?
\>>>
\>> An alternative might be a subclass of int.
\>
\> It could make sense to use a subclass of int that emitted deprecation
\> warnings for integer arithmetic, and then eventually disallowed it
\> entirely.
\>
\> Cheers,
\> Nick.
\>
\> --
\> Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
\> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\> Python-Dev mailing list
\> Python-Dev@python.org
\> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org



\--
\--Guido van Rossum (python.org/\~guido)
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/pludemann%40google.com