|
1 | 1 | """Fixer for __metaclass__ = X -> (six.with_metaclass(X)) methods. |
2 | 2 |
|
3 | | - The various forms of classdef (inherits nothing, inherits once, inherits |
4 | | - many) don't parse the same in the CST, so we look at ALL classes for |
5 | | - a __metaclass__ and if we find one normalize the inherits to all be |
6 | | - an arglist. |
| 3 | +The various forms of classdef (inherits nothing, inherits once, inherits |
| 4 | +many) don't parse the same in the CST, so we look at ALL classes for |
| 5 | +a __metaclass__ and if we find one normalize the inherits to all be |
| 6 | +an arglist. |
7 | 7 |
|
8 | | - For one-liner classes ('class X: pass') there is no indent/dedent so |
9 | | - we normalize those into having a suite. |
| 8 | +For one-liner classes ('class X: pass') there is no indent/dedent so |
| 9 | +we normalize those into having a suite. |
10 | 10 |
|
11 | | - Moving the __metaclass__ into the classdef can also cause the class |
12 | | - body to be empty so there is some special casing for that as well. |
| 11 | +Moving the __metaclass__ into the classdef can also cause the class |
| 12 | +body to be empty so there is some special casing for that as well. |
13 | 13 |
|
14 | | - This fixer also tries very hard to keep original indenting and spacing |
15 | | - in all those corner cases. |
| 14 | +This fixer also tries very hard to keep original indenting and spacing |
| 15 | +in all those corner cases. |
16 | 16 | """ |
| 17 | + |
17 | 18 | # This is a derived work of Lib/lib2to3/fixes/fix_metaclass.py. That file |
18 | 19 | # is under the copyright of the Python Software Foundation and licensed |
19 | 20 | # under the Python Software Foundation License 2. |
|
0 commit comments