示例代码:

class Car(object):
# 未定义任何类属性 def move(self): # 方法会出现下划线提示This inspection detects any methods which may safely be made static.
print("---车在移动---") def stop(self):
print("---停车---")

原因是该方法不涉及对该类属性的操作,编译器建议声明为@staticmethod,面向对象思想体现

扩展知识

PEP8编码规范

pycharm提示This inspection detects any methods which may safely be made static.的更多相关文章

  1. pycharm提示This inspection detects instance attribute definition outside __init__ method

    示例代码: class MiNiCarStore(CarStore): def createCar(self, typeName): self.carFactory = CarFactory() # ...

  2. 【PyCharm编辑器】之无法导入引用手动新建的包或类,报:This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases.

    一.现象描述 如下图所示,手动新建个类包calculator.py,想在test.py文件引用它,发现一直报红线,引用失败 Unresolved reference 'calculator' less ...

  3. this inspection detects names that should resolved but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are sup

    输入第一行代码:import logging;logging.basicConfig(level==logging.INFO) 提示:this inspection detects names tha ...

  4. TortoiseGit做push时提示Disconnected: No supported authentication methods available (server sent: publickey)错误

    通过Git从远程服务器上获得到自己的项目,但是通过TortoiseGit做push时提示Disconnected: No supported authentication methods availa ...

  5. pycharm 提示:this license **** has been cancelled(2)

    pycharm安装激活过程中,提示 this license **** has been cancelled .这个问题并不是你的激活码不对,而是需要修改系统的hosts文件,下面详细讲解下如何修改h ...

  6. This inspection detects shadowing names defined in outer scopes.

    错误信息:This inspection detects shadowing names defined in outer scopes. 检查到波浪处的单词已在函数外部定义. 解决:使用global ...

  7. 解决pycharm 提示no tests were found的问题

    在使用pycharm,做日志模块封装,代码中觉得没有问题,运行就提示no  tests were found 查询了下这个问题,原因是我创建的类名是以test方法开头,类似这样 不知道是不是把它默认当 ...

  8. pycharm提示your evalluation license has expired解决方法

    安装pycharm,一段时间后提示your evalluation license has expired:打开pycharm--点击help--register--选中license server, ...

  9. PyCharm提示ModuleNotFoundError: No module named 'pymysql'

    初学python,连接mysql时遇到了提示pymysql模块导入有问题,本人虽是window系统,解决思路是一样的 代码如下: import pymysql#打开数据库,参数依次为:主机名/IP,用 ...

随机推荐

  1. 【逆向笔记】2017年全国大学生信息安全竞赛 Reverse 填数游戏

    2017年全国大学生信息安全竞赛 Reverse 填数游戏 起因是吾爱破解大手发的解题思路,觉得题挺有意思的,就找来学习学习 这是i春秋的下载链接 http://static2.ichunqiu.co ...

  2. 通过HTTP服务访问FTP服务器文件(配置nginx+ftp服务器)

    1.前提 已安装配置好nginx+ftp服务 2.配置Nginx 服务器 2.1进入nginx 配置文件目录: cd  /usr/local/nginx/conf vi  nginx.conf 2.2 ...

  3. list补充,append()、extend()、insert()、remove()、del()、pop()、分片

    1.添加 append(object),是指在列表的末尾添加一个元素. >>> arr = [1,2,'a','你好',[11,22,33]] >>> arr [1 ...

  4. graph slam BACK END 相关技术资料收集

    学习SLAM首推2个网站: 1. WIKI上的SLAM介绍与资源总结:http://en.wikipedia.org/wiki/Simultaneous_localization_and_mappin ...

  5. SpringSecurity实现短信登录功能

    ⒈封装短信验证码类 package cn.coreqi.security.validate; import java.time.LocalDateTime; public class Validate ...

  6. 2018牛客暑期ACM多校训练营第一场(有坑未填)

    (重新组队后的第一场组队赛 也是和自己队友的一次磨合吧 这场比赛真的算是一个下马威吧……队友上手一看 啊这不是莫队嘛 然后开敲 敲完提交发现t了 在改完了若干个坑点后还是依然t(真是一个悲伤的故事)然 ...

  7. Linux中设置别名

    作者:邓聪聪 查看别名: alias设置别名: 临时设置: alias show='ls -al' 永久生效: 修改 家目录/.bashrc [root@localhost ~]# cat .bash ...

  8. smarty半小时快速上手教程

    一:smarty的程序设计部分: 在smarty的模板设计部分我简单的把smarty在模板中的一些常用设置做了简单的介绍,这一节主要来介绍一下如何在smarty中开始我们程序设计.下载Smarty文件 ...

  9. Media Query-响应式布局

    做响应式网站的时候,一定要在页面头部加入如下的声明: <meta name="viewport" content="width=device-width, init ...

  10. 微信小程序采坑(一)

    1.微信小程序如何让text内容空格 <text decode="{{true}}" space="{{true}}">  </text> ...