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,用 ...
随机推荐
- ASP.NET - 学习总目录
ASP.NET - 处理页面 ASP.NET - ADO.NET框架 ASP.NET - 创建功能菜单 ASP.NET MVC - 入门 ASP.NET MVC - 模型验证 ASP.NET MVC ...
- Nginx系列0:Nginx学习历程
Nginx学习历程 一.初识Nginx 1.Nginx适用于哪些场景 (1)静态资源服务 通过本地文件系统提供服务 (2)反向代理服务 Nginx的强大性能 缓存 负载均衡 (3)API服务 Open ...
- Queue和BlockingQueue的使用以及使用BlockingQueue实现生产者-消费者
Java提供了两种新的容器类型:Queue和BlockingQueue. Queue用于保存一组等待处理的元素.它提供了几种实现,包括:ConcurrentLinkedQueue,这是一个先进先出的并 ...
- FireDac 的一些应用提示
FireDac 的一些应用提示: 1. 客户端 dataset 能用 TFDQuery 连接 dataset provider 获取数据 ? Can I use TFDQuery and conne ...
- cosmic_download-AsyncPool待修正
# !/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/11/16 10:02 AM # @Author : cxa # @File ...
- 理解OAuth 2.0(转)
OAuth是一个关于授权(authorization)的开放网络标准,在全世界得到广泛应用,目前的版本是2.0版. 本文对OAuth 2.0的设计思路和运行流程,做一个简明通俗的解释,主要参考材料 ...
- unity实现剧情对话
using UnityEngine; using System.Collections; public class Test : MonoBehaviour { private string show ...
- NLog类库使用探索——详解配置
1 配置文件的位置(Configuration file locations) 通过在启动的时候对一些常用目录的扫描,NLog会尝试使用找到的配置信息进行自动的自我配置. 1.1 单独的*.exe客户 ...
- 【转】Java内部类详解
一.内部类基础 在Java中,可以将一个类定义在另一个类里面或者一个方法里面,这样的类称为内部类.广泛意义上的内部类一般来说包括这四种:成员内部类.局部内部类.匿名内部类和静态内部类.下面就先来了解一 ...
- CSS3 Hover 动画特效
根据 奇舞团:http://www.75team.com/archives/807 做的demo 根据视频中跟着做的 demo1: <!DOCTYPE html> <html lan ...