Python beginner here. Don't understand why intellisense for some psycopg2 objects doesn't work in PyCharm.
import psycopg2
from config import db_config
from datetime import datetime
conn = None
cursor = None
try:
params = db_config
conn = psycopg2.connect(**params)
cursor = conn.cursor()
except (Exception, psycopg2.DatabaseError) as error:
print(error)
finally:
if conn:
cursor.close()
conn.close()
print("connection closed")
cursor() method not offered:
cannot step into the definition here:
Do I have to somehow specify the types of the objects during declaration e.g.:
cursor: cursor = None