PEP suggestion: Uniform way to indicate Python language version
rocky
rocky at gnu.org
Mon Aug 22 08:52:31 EDT 2016
More information about the Python-list mailing list
Mon Aug 22 08:52:31 EDT 2016
- Previous message (by thread): PEP suggestion: Uniform way to indicate Python language version
- Next message (by thread): PEP suggestion: Uniform way to indicate Python language version
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Monday, August 22, 2016 at 8:45:05 AM UTC-4, Chris Angelico wrote: > On Mon, Aug 22, 2016 at 10:05 PM, Marko Rauhamaa <marko at pacujo.net> wrote: > > rocky <rocky at gnu.org>: > > > >> A slightly different but related problem is noting the Python dialect > >> at the package-level. > > > > I don't know what if anything is needed support this idea, but one > > option would be to just use "import": > > > > import python3_5_17 > > > > That would require Python and modules to install such empty modules to > > indicate that they support the given API. > > Preferable: > > from python import v35 > > Then a single 'python.py' could have lines for every supported > version, rather than forcing dozens of separate modules. > > However, I don't think it's particularly necessary. Explicit version > number checks should be very rare, and shouldn't be encouraged. > Instead, encourage feature checks, as Steve gave some examples of. > > ChrisA Yes, "from python import v35" is better. How do feature checks in the code address the problem static analysis of source code?
- Previous message (by thread): PEP suggestion: Uniform way to indicate Python language version
- Next message (by thread): PEP suggestion: Uniform way to indicate Python language version
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list