[Python-ideas] Code version evolver

Chris Angelico rosuav at gmail.com
Fri Mar 15 18:09:41 EDT 2019

On Sat, Mar 16, 2019 at 7:35 AM francismb <francismb at email.de> wrote:
> Thanks!
> On 3/15/19 8:56 PM, Chris Angelico wrote:
> > The same is true of books that discuss the language, blog posts giving
> > tips and tricks, Stack Overflow answers, and everything else that
> > incorporates code that people might want to copy and paste. What
> > version of Python do you need? What's the oldest that it still works
> > on, and what's the newest before something breaks it?
> > Backward-incompatible changes make that EXTREMELY hard.
> > Backward-compatible changes make it only a little bit harder, as they
> > set a minimum but not a maximum.
> >... that seems to be a use case for a function like, e.g.
> "is-python-code(version-to-ask-for, code-snipped)" ;-) (Wanna search the
> min. and max. python working points/ranges ? loop over e.g. 3.0 .. 3.X)

Python 3.5 introduced the modulo operator for bytes objects. How are
you going to write a function that determines whether or not a piece
of code depends on this?

And, are you going to run this function on every single code snippet
before you try it?

I don't think this is possible, AND it's most definitely not a
substitute for backward compatibility.


More information about the Python-ideas mailing list