github / github/codeql

How to suppress "module import itself" in python

Offen
#7,224 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Python question
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.