문제

PyCharm's code inspection is a useful tool, but sometimes it gets things wrong. I know you can disable whole classes of warnings via settings, but what if you just want to dismiss a specific instance of a warning at a particular line?

도움이 되었습니까?

해결책

1. Alt + Enter while cursor standing on problematic place.

2. Select appropriate entry from appeared popup menu.

3. Expand submenu (click on small triangle on the right side .. or just press arrow right key on keyboard.

4. Choose "Suppress for statement" from there.

In the end special comment will be added just before that line that would temporarily turn off that specific inspection for next statement.

This is how it looks in PhpStorm (sorry, I'm not PyCharm or Python user):

enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top