When initializing a dictionary with d = {} Pycharm\'s code inspector generates a warning, saying
This dictionary creation could be rewrit
What is the following code to your dictionary declaration?
I think pycharm will trigger the error if you have something like:
dic = {}
dic['aaa'] = 5
as you could have written
dic = {'aaa': 5}
BTW: The fact that the error goes away if you use the function doesn't necessarily mean that pycharm believes dict() is a literal. It could just mean that it doesn't complain for:
dic = dict()
dic['aaa'] = 5
HTH!