仅通过最脏的方法来模拟其他人的脏屁股不符合pep的代码的健全性。

pysanit的Python项目详细描述


仅通过最脏的方法来模拟其他人的脏屁股不符合pep的代码的健全性。

使用Python2.7、3.5进行测试。

Test StatusCoverage StatusDocumentation Status

那意味着?

嗨!我是侏儒

importlogginglog=logging.getLogger(__name__)

更不用说大脑麻木:

frompysanityimportlogginglog=logging.get_logger(__name__)

所有的同时保持您宝贵的代码完成工作,因为不严重的过度动态性质预期。

不必欢迎我在PyPI上生存。

记录你说的?

提示:尝试一下,不要再接受代码中不必要的样板文件,stdlib与否:

importloggingimportlogging.configimportinspectdef_namespace_from_calling_context():"""
    Derive a namespace from the module containing the caller's caller.

    :return str: the fully qualified python name of a module.
    """returninspect.currentframe().f_back.f_back.f_globals['__name__']defget_logger(name=None):"""
    Gets a logger instance with sensible defaults according to caller context.

    :param str name: Logger name. Defaults to caller's `__name__`.
    :return logging.Logger: Logger instance
    """ifnotname:name=_namespace_from_calling_context()returnlogging.getLogger(name)

安装

pip install pysanity

运行测试

tox用于测试多个python版本。

tox

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将springboot war部署到debian jetty8   java破坏了函数,即使它看起来是正确的   当MockMvc不可自动编译时,java会有选择地从Spring Security向其应用单个过滤器   java AndroidStudio每秒播放n次生成的声音   JavaJBossSeam:继承的方法被拦截了吗?   ScheduledExecutorService中线程默认名称中池号的java含义   在Java中用递归方法实现类Fibonacci的递归   java虚拟路径/文件夹   java即时与ZoneDateTime。转换到另一时区   用GaussLegendre算法在java中逼近Pi   java RecyclerView findFirstVisibleItemPosition()返回1   java根据当前经过身份验证的用户的角色返回不同的JSON对象   java从内部类访问扩展类的方法   Android程序中的Java语法WRT静态方法   可选参数初始化Java字符串文字时出错