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.

Overriden methods of C/C++ extensions

See original GitHub issue

Originally reported by: Florian Bruhin (Bitbucket: The-Compiler, GitHub: The-Compiler)


When subclassing a method of a class defined in a C/C++ extension, such as this example using the PyQt GUI framework:

from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import QLineEdit, QApplication


class LineEdit(QLineEdit):

    def sizeHint(self):
        return QSize(128, 128)

app = QApplication([])
le = LineEdit()
le.show()
app.exec_()

vulture doesn’t detect that sizeHint is called via C++:

foo.py:7: Unused function 'sizeHint'

Maybe if a class inherits from a non-Python class, and an existing method is overridden, it should always be considered used?


Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jendrikseippcommented, Aug 16, 2018

Now that we have a repository for whitelist generators at https://github.com/RJ722/vulture-whitelist-generators, I think we can close this issue.

0reactions
RJ722commented, Jul 8, 2018

Hey Jendrik,

Ongoing action occurring at https://github.com/RJ722/vulture-whitelist-generators/tree/generate. I’ve an ongoing PR which is just one final review from @The-Compiler away from alpha release 1. 😛

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to override an existing extension method - Stack Overflow
Extension methods cannot be overridden since they are not instance methods and they are not virtual. The compiler will complain ...
Read more >
Overriding extension methods (Should know) | Instant .NET ...
Extension methods cannot be overridden the way classes and instance methods are. They are overridden by a slight trick in how the compiler...
Read more >
Overriding Chrome pages
Override pages are a way to substitute an HTML file from your extension for a page that Google Chrome normally provides.
Read more >
How to override Save method in standard controller extension?
I am wriiting a extension on Case object. There I want to write a save method with my own logic and want this...
Read more >
Extension Methods in C# - C# Corner
Extension methods cannot be used to override existing methods. The concept of extension methods cannot be applied to fields, properties or ...
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