-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't access certain members errors #5828
Comments
I tried to reproduce this from your screenshot + requirements.txt, but was unsuccessful. Please provide a complete, minimal code sample (as text!) that reproduces the behavior you are seeing. The screenshot you provided above is missing imports, etc. |
Here's one where it can't find database in cantools. |
Here is the log for that. |
where can one finds that said, for your import can
import time
import cantools
import cantools.database
from cantools.database.can.database import Database
from cantools.database.can.message import Message
bus = None
def send_message(msg: Message):
signal_values = {}
signal_db = {}
for signal in msg.signals:
signal_values[signal.name] = signal.minimum
signal_db[signal.name] = {'minimum':signal.minimum, 'maximum':signal.maximum}
while True:
data = msg.encode(signal_values)
message = can.Message(arbitration_id=msg.frame_id, data=data, is_extended_id=True)
assert(bus is not None)
bus.send(message)
for key in signal_values:
signal_values[key] += 1
if signal_values[key] > signal_db[key]['maximum']:
signal_values[key] = signal_db[key]['minimum']
time.sleep(1) # Send a message every second
if __name__ == '__main__':
bus = can.Bus(interface='udp_multicast', channel='239.0.0.1', port=10000, receive_own_messages=False)
db = cantools.database.load_file('../envgo/dbc/xerotech_battery_j1939.dbc')
assert(isinstance(db, Database))
for msg in db.messages:
if 'VCU' not in msg.senders:
send_message(msg)
break |
This issue has been closed automatically because it needs more information and has not had recent activity. If the issue still persists, please reopen with the information requested. Thanks. |
Environment data
Code Snippetfrom PySide6.QtCore import Qt
print(type(Qt.DisplayRole))
print(type(Qt.ItemDataRole.DisplayRole)) Repro Steps
Expected behaviorQt.DisplayRole should autocomplete and not show an error in PyLance Actual behaviorPylance can't find Qt.DisplayRole, and throws the error below. The code runs and works as expected.
Logs |
I believe the issue with your example is that Qt.DisplayRole is not in the stub that way so QtCore must be moving it up one level at runtime (it's dynamic behavior and not supported by Pylance). |
Environment data
Code Snippet
Repro Steps
Access things like Qt.DisplayRole or Qt.EditRole. Code works fine, but pylance can't find the members.
Logs
pylance_issues.log
requirements.txt
The text was updated successfully, but these errors were encountered: