Home | History | Annotate | Download | only in python
      1 /*
      2   Warnings for Python keywords, built-in names and bad names.
      3 */
      4 
      5 #define PYTHONKW(x) %keywordwarn("'" `x` "' is a python keyword, renaming to '_" `x` "'", rename="_%s")  `x`
      6 #define PYTHONBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in python")  `x`
      7 
      8 
      9 /*
     10   Warnings for Python keywords
     11   http://www.fnorb.org/docs/1.2/Fnorb-Guide/node62.html
     12 */
     13 
     14 PYTHONKW(and);
     15 PYTHONKW(assert);
     16 PYTHONKW(break);
     17 PYTHONKW(class);
     18 PYTHONKW(continue);
     19 PYTHONKW(def);
     20 PYTHONKW(del);
     21 PYTHONKW(elif);
     22 PYTHONKW(else);
     23 PYTHONKW(except);
     24 PYTHONKW(exec);
     25 PYTHONKW(finally);
     26 PYTHONKW(for);
     27 PYTHONKW(from);
     28 PYTHONKW(global);
     29 PYTHONKW(if);
     30 PYTHONKW(import);
     31 PYTHONKW(in);
     32 PYTHONKW(is);
     33 PYTHONKW(lambda);
     34 PYTHONKW(not);
     35 PYTHONKW(or);
     36 PYTHONKW(pass);
     37 PYTHONKW(print);
     38 PYTHONKW(raise);
     39 PYTHONKW(return);
     40 PYTHONKW(try);
     41 PYTHONKW(while);
     42 PYTHONKW(yield);
     43 
     44 /*
     45   built-in functions
     46   http://www.zvon.org/other/python/doc21/lib/built-in-funcs.html
     47  */
     48 
     49 PYTHONBN(abs);
     50 PYTHONBN(apply);
     51 PYTHONBN(bool);
     52 PYTHONBN(buffer);
     53 PYTHONBN(callable);
     54 PYTHONBN(chr);
     55 PYTHONBN(classmethod);
     56 PYTHONBN(cmp);
     57 PYTHONBN(coerce);
     58 PYTHONBN(compile);
     59 PYTHONBN(complex);
     60 PYTHONBN(delattr);
     61 PYTHONBN(dict);
     62 PYTHONBN(dir);
     63 PYTHONBN(divmod);
     64 PYTHONBN(enumerate);
     65 PYTHONBN(eval);
     66 PYTHONBN(execfile);
     67 PYTHONBN(file);
     68 PYTHONBN(filter);
     69 PYTHONBN(float);
     70 PYTHONBN(frozenset);
     71 PYTHONBN(getattr);
     72 PYTHONBN(globals);
     73 PYTHONBN(hasattr);
     74 PYTHONBN(hash);
     75 PYTHONBN(hex);
     76 PYTHONBN(id);
     77 PYTHONBN(input);
     78 PYTHONBN(int);
     79 PYTHONBN(intern);
     80 PYTHONBN(isinstance);
     81 PYTHONBN(issubclass);
     82 PYTHONBN(iter);
     83 PYTHONBN(len);
     84 PYTHONBN(list);
     85 PYTHONBN(locals);
     86 PYTHONBN(long);
     87 PYTHONBN(map);
     88 PYTHONBN(max);
     89 PYTHONBN(min);
     90 PYTHONBN(object);
     91 PYTHONBN(oct);
     92 PYTHONBN(open);
     93 PYTHONBN(ord);
     94 PYTHONBN(pow);
     95 PYTHONBN(property);
     96 PYTHONBN(range);
     97 PYTHONBN(raw_input);
     98 PYTHONBN(reduce);
     99 PYTHONBN(reload);
    100 PYTHONBN(repr);
    101 PYTHONBN(reversed);
    102 PYTHONBN(round);
    103 PYTHONBN(set);
    104 PYTHONBN(setattr);
    105 PYTHONBN(slice);
    106 PYTHONBN(sorted);
    107 PYTHONBN(staticmethod);
    108 PYTHONBN(str);
    109 PYTHONBN(sum);
    110 PYTHONBN(super);
    111 PYTHONBN(tuple);
    112 PYTHONBN(type);
    113 PYTHONBN(unichr);
    114 PYTHONBN(unicode);
    115 PYTHONBN(vars);
    116 PYTHONBN(xrange);
    117 PYTHONBN(zip);
    118 
    119 
    120 /*
    121    built-in names
    122    boolean type and None
    123 */
    124 PYTHONBN(True);
    125 PYTHONBN(False);
    126 
    127 PYTHONKW(None);
    128 
    129 
    130 /*
    131    'self' is also a bad Name
    132 */
    133 PYTHONBN(self);
    134 
    135 #undef PYTHONBN
    136 #undef PYTHONKW
    137