youtube / spitfire

A high-performance Python template language
BSD 3-Clause "New" or "Revised" License
404 stars 58 forks source link

Standardize all imports to prefer the "from PACKAGE import MODULE" syntax #33

Closed nicksay closed 8 years ago

nicksay commented 8 years ago

This change standardizes all imports to the from PACKAGE import MODULE form. This means that

import spitfire.compiler.parser
...
spitfire.compiler.parser.SpitfireParser(...)

becomes

from spitfire.compiler import parser
...
parser.SpitfireParser(...)

Also, all from PACKAGE.MODULE import * forms have been removed, and the relevant references prefixed with the module name. This means that

from spitfire.compiler.ast import *
...
FunctionNode(...)

becomes

from spitfire.compiler import ast
...
ast.FunctionNode(...)

Finally, all module aliasing has been removed except for those cases where a C-based module is used in favor of a Python-based one. This means that

import cStringIO as StringIO
import spitfire.compiler.compiler as sptcompiler
...
compiler = sptcompiler.Compiler(...)

becomes

import cStringIO as StringIO
from spitfire.compiler import compiler
...
spt_compiler = compiler.Compiler(...)

Closes #27

nicksay commented 8 years ago

Like #25, I'm going to wait until the full test suit is fixed (see #26).

nicksay commented 8 years ago

@awbraunstein This is ready for another look

awbraunstein commented 8 years ago

lgtm