473,480 Members | 2,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Assigning datatype to variable in python

5 New Member
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
1 1400
bvdet
2,851 Recognized Expert Moderator Specialist
Generally, you cannot change the expected argument data type when creating an instance in Python.
Aug 5 '14 #2

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

Similar topics

6
6723
by: Hansan | last post by:
Hi all. I am working on a webpage where I use python and html. When I want to send one variable to a new script/page I use the following code: 0) print '''<input type=hidden name="eventid"...
0
1527
by: Chumley the Walrus | last post by:
I need to assign a variable to a record drawn from a db by way of a repeater control: <ASP:Repeater id="thedata" runat="server"> <itemtemplate> <%dim display display =...
6
10087
by: adamrfrench | last post by:
Let it be mentioned that Javascript is not my forte, so the solution to this could very well be a simple one. I am working on an AJAX function where I can pass a URL and the target ID in, and...
1
1751
by: James | last post by:
Is it possible to use a variable to indicate a field that you want updated ? x=12 Variable="" RS.Edit RS!Variable= x RS.Update
3
9473
by: Cleo | last post by:
How would I hard code a certain variable to be stored in a specific memory location in a processor. When I declare a variable in my program, the linker automatically determines a location and assigns...
3
1652
by: VadiRkp | last post by:
Hello, I'm want to set up a function that, based on the string and an int argument that is given to it, will set an an int variable to the given value. The int variable is already declared, so the...
1
1429
by: bellino771 | last post by:
Hey Guys, I am trying to assign the output of this command, import os os.system(exritool nc-stats.ri pm-radiator.inlet.ssh.nc -detail | grep -A 2 MKS | tail -1 | awk '{print $2, $3, $4}') ...
2
1215
by: teddarr | last post by:
I have a C# project that uses datasets to pull data out of a SQL server database. I have 3 controls on the windows form that are bound to the dataset, but I have a 4th attribute that I want sent to...
9
2139
by: J. Peng | last post by:
I just thought python's way of assigning value to a variable is really different to other language like C,perl. :) Below two ways (python and perl) are called "pass by reference", but they get...
3
2383
by: sasimca007 | last post by:
Hello friends, IN modperl we write perl with html,javascript and etc. when we are writing perl code in the middle of javascript and if we want to assign a javascript variable...
0
7039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.