pycharm提示This inspection detects any methods which may safely be made static.
示例代码:
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.的更多相关文章
- pycharm提示This inspection detects instance attribute definition outside __init__ method
示例代码: class MiNiCarStore(CarStore): def createCar(self, typeName): self.carFactory = CarFactory() # ...
- 【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 ...
- 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 ...
- TortoiseGit做push时提示Disconnected: No supported authentication methods available (server sent: publickey)错误
通过Git从远程服务器上获得到自己的项目,但是通过TortoiseGit做push时提示Disconnected: No supported authentication methods availa ...
- pycharm 提示:this license **** has been cancelled(2)
pycharm安装激活过程中,提示 this license **** has been cancelled .这个问题并不是你的激活码不对,而是需要修改系统的hosts文件,下面详细讲解下如何修改h ...
- This inspection detects shadowing names defined in outer scopes.
错误信息:This inspection detects shadowing names defined in outer scopes. 检查到波浪处的单词已在函数外部定义. 解决:使用global ...
- 解决pycharm 提示no tests were found的问题
在使用pycharm,做日志模块封装,代码中觉得没有问题,运行就提示no tests were found 查询了下这个问题,原因是我创建的类名是以test方法开头,类似这样 不知道是不是把它默认当 ...
- pycharm提示your evalluation license has expired解决方法
安装pycharm,一段时间后提示your evalluation license has expired:打开pycharm--点击help--register--选中license server, ...
- PyCharm提示ModuleNotFoundError: No module named 'pymysql'
初学python,连接mysql时遇到了提示pymysql模块导入有问题,本人虽是window系统,解决思路是一样的 代码如下: import pymysql#打开数据库,参数依次为:主机名/IP,用 ...
随机推荐
- tarjan算法(求强连通子块,缩点)
tarjan算法求图中的强连通子图的个数. #include<iostream> #include<stack> #include<queue> #include& ...
- mongodb系列~ mongodb慢语句(1)
1 简介:讲讲mongo的慢日志2 慢日志类型 query insert update delete 3 查看慢日志 1 db.system.profile.find() 慢日志总揽 2 d ...
- OVS-----CentOS7.2上安装OVS软件
1.安装依赖包: yum -y install make gcc openssl-devel autoconf automake rpm-build redhat-rpm-config yum -y ...
- SpringSecurity如何退出登录
⒈如何退出登录? SpringSecurity默认为我们提供了退出操作,我们只需要访问特定的url就可以退出登录了 <!DOCTYPE html> <html lang=" ...
- 从url(地址栏)获取参数:Jquery中getUrlParam()方法的使用
我想要获取如下id 如下代码(传参要加问好!!) function getUrlParam(id) { var regExp = new RegExp('([?]|&)' + id+ '=([ ...
- InstallShield 静默安装
可能先需要获取安装包参数,安装包参数获取/?或是/HELP InstallScrip工程 1. 在命令行窗口中使用 -R 参数(即record) 运行安装程序. 例如: Setup.exe -R or ...
- noi.ac 集合
A.集合 --- 题面 不知道有没有用的传送门[滑稽 就是给你一个 包含 1~n 的集合,让你求它的大小为 k 的子集 s 的 \(T^{min(s)}\) 的期望值, T 为给出值, min(s) ...
- 035_lua快速入门
执行下面的脚本用luajit test.lua即可 一.变量及逻辑运算 --number, string, boolean, table, function, thread, userdata, ni ...
- pycharm 中自动补全代码提示前符号 p,m ,c,v, f 是什么意思
是自动补全的变量的类别p:parameter 参数m:method 方法c:class 类 v:variable 变量f:function 函数
- 【原创】大叔经验分享(33)hive select count为0
hive建表后直接将数据文件拷贝到table目录下,select * 可以查到数据,但是select count(1) 一直返回0,这个是因为hive中有个配置 hive.stats.autogath ...