github / github/codeql

How to suppress "module import itself" in python

Open
#7,224 2 comments 0 reactions 0 assignees View on GitHub
Python question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

Greetings,

I have a module created by cython, all I want is to display the type annotations for cython functions, so I wrap the cython functions inside of python functions in `__init__.py`, it looks like this:
```
#__init__.py of myCyModule

from . import _myCyModule

def func(a:int, b:int, c:int)->int:
return _myCyModule(a, b, c)
```
Folder structure of the Module would be like:
```
myCyModule
|__ __init__.py
|__ _myCyModule.pyd
```

How can I suppress "module import itself" alert in such a case? Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.