By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

Assigning datatype to variable in python

P: 5
Hi,

I've created new signal , where i specify list and object datatype.

dataChanged = QtCore.Signal(list, object)

But list and object datatype don't convey properly that what will be in list and in the object.
So it would be good if we could declare something like this,

dataChanged = QtCore.Signal(lst_employees, obj_sender)

so that, if anyone sees the code, would understand easily. But i don't know it's possible in Python or not.

But i have done something like this, i don't know this is correct or not

lst_employees = list
obj_sender = object

dataChanged = QtCore.Signal(lst_employees, obj_sender)


Is this right and pythanic way to use ? Please guide me.


Thanks
Ravi
Aug 5 '14 #1
Share this Question
Share on Google+
1 Reply


bvdet
Expert Mod 2.5K+
P: 2,851
Generally, you cannot change the expected argument data type when creating an instance in Python.
Aug 5 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.