question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Classes in extension modules do not have full paths for name of module (__module__ attribute)

See original GitHub issue
Nuitka: 0.6.6
Python: 3.6.9 (default, Nov 23 2019, 06:41:34) 
Executable: /usr/local/bin/python
OS: Linux
Arch: x86_64

Nuitka was installed with pip install nuitka

I am using the following to generate modules:

python -m nuitka --module --python-flag=-OO --remove-output --full-compat --lto --output-dir={} {}

All seems to work fine, but I have noticed a difference between the original code and the compiled version, when running the following code:

from app import pipelines
import inspect

for member in inspect.getmembers(pipelines, inspect.isclass):
    print(member[1].__module__)

The original code returns app.pipelines.Pipeline, while the compiled one returns Pipeline.

Is this expected behaviour?

Thank you,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Jan 22, 2020

This is now on the develop branch, and awaits release.

1reaction
kayhayencommented, Jan 10, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Is module __file__ attribute absolute or relative?
From what I understand, __file__ returns the absolute path from which the module was loaded. I'm having problem producing this: I have a...
Read more >
importlib — The implementation of import — Python 3.11.1 ...
An abstract method that is to return the value of __file__ for the specified module. If no path is available, ImportError is raised....
Read more >
Extension Methods - Visual Basic | Microsoft Learn
The Extension attribute can only be applied to a Visual Basic Module , Sub , or Function . If you apply it to...
Read more >
JAR File Specification
A non-modular JAR file deployed on the module path is an automatic module. If the JAR file has a main attribute Automatic-Module-Name (see...
Read more >
CommonJS modules | Node.js v19.3.0 Documentation
The module.exports property can be assigned a new value (such as a ... Files with an extension that is not .mjs , .cjs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found