Staging
v0.5.1
swh:1:snp:635f4099902912592851108bcac178ff574f7c5f
Raw File
Tip revision: 1da43e5e916949c8e849e656d9d05fa4b9d6836c authored by Benjamin Peterson on 26 June 2009, 13:21:52 UTC
rearrange the sections of the README, so they'll hopefully be more in the order people will interested in
Tip revision: 1da43e5
fix_long.py
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that turns 'long' into 'int' everywhere.
"""

# Local imports
from .. import fixer_base
from ..fixer_util import Name, Number, is_probably_builtin


class FixLong(fixer_base.BaseFix):

    PATTERN = "'long'"

    static_int = Name("int")

    def transform(self, node, results):
        if is_probably_builtin(node):
            new = self.static_int.clone()
            new.prefix = node.prefix
            return new
back to top