ó
'![c           @   s·   d  Z  d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d g Z	 e j
 d k  ry e	 j d
 ƒ n  i d d 6Z e d e d <d e f d „  ƒ  YZ d „  Z d S(   s    Checker for deprecated builtins.iÿÿÿÿN(   t   BaseChecker(   t   check_messages(   t   IAstroidCheckert   mapt   filteri   i    t   inputs*   Using a list comprehension can be clearer.t   BadBuiltinCheckerc           B   sd   e  Z e f Z d  Z i d d 6Z d i e d 6d d 6d	 d
 6d d 6f f Z e d ƒ d „  ƒ Z	 RS(   t   deprecated_builtinss   Used builtin function %ss   bad-builtinsÚ   Used when a black listed builtin function is used (see the bad-function option). Usual black listed functions are the ones like map, or filter , where Python offers now some cleaner alternative like list comprehension.t   W0141s   bad-functionst   defaultt   csvt   types   <builtin function names>t   metavarsM   List of builtins function names that should not be used, separated by a commat   helpc         C   s±   t  | j t j ƒ r­ | j j } | | j ƒ  k pB | | j ƒ  k s­ | |  j j k rª t	 j
 | ƒ } | r d | | f } n t | ƒ } |  j d d | d | ƒqª q­ n  d  S(   Ns   %r. %ss   bad-builtint   nodet   args(   t
   isinstancet   funct   astroidt   Namet   namet   framet   roott   configt   bad_functionst   BUILTIN_HINTSt   gett   reprt   add_message(   t   selfR   R   t   hintR   (    (    s<   lib/python2.7/site-packages/pylint/extensions/bad_builtin.pyt
   visit_call-   s    $(   s   Used builtin function %ss   bad-builtinsÚ   Used when a black listed builtin function is used (see the bad-function option). Usual black listed functions are the ones like map, or filter , where Python offers now some cleaner alternative like list comprehension.(
   t   __name__t
   __module__R   t   __implements__R   t   msgst   BAD_FUNCTIONSt   optionsR   R   (    (    (    s<   lib/python2.7/site-packages/pylint/extensions/bad_builtin.pyR      s   	 

c         C   s   |  j  t |  ƒ ƒ d S(   s   Required method to auto register this checker.

    :param linter: Main interface object for Pylint plugins
    :type linter: Pylint object
    N(   t   register_checkerR   (   t   linter(    (    s<   lib/python2.7/site-packages/pylint/extensions/bad_builtin.pyt   register=   s    (   i   i    (   t   __doc__t   sysR   t   pylint.checkersR    t   pylint.checkers.utilsR   t   pylint.interfacesR   R$   t   version_infot   appendR   R   R(   (    (    (    s<   lib/python2.7/site-packages/pylint/extensions/bad_builtin.pyt   <module>   s   
$