Skip to content

jwilk/python-syntax-errors

master
Switch branches/tags
Code

Latest commit

This is shorter, and the original code made pyflakes unhappy:

    $ python3 -m pyflakes since-3.8.py
    since-3.8.py:1:10 local variable 'x' is assigned to but never used
44f59e7

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This is a collection of no-op statements that are syntactically valid only since Python X.Y, for most X.Y ≥ 2.4.

For example:

0_0  # Python >= 3.6 is required

The idea is to put such a statement near the top of your file. If a user inadvertently ran the code against an older version, they would get a fairly helpful error message:

$ python3.5 since-3.6.py
  File "since-3.6.py", line 1
    0_0  # Python >= 3.6 is required
      ^
SyntaxError: invalid syntax

About

no-op statements syntactically valid only since Python X.Y

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages