Thursday, March 1, 2012

Type casting issue apparent in pygtk programming work

Something interesting when working between widgets in pygtk here, integers may according to widget's referring container may convert these values to floats or some type of numeric cast, thus neither preserving original type assignment. Sort of important since type casting issues, may less commonly be noticed in python owing to the loss of formalities in variable object declarations. One example of this is can be represented in one line where a = 1, and the next line where a = 1.0. The variable a is represented as integer in one line, while in the subsequent line is represented as a float. Further example, assigning integer values into spinboxes leads to the result of a type casting transformation to (double, float type) an associated gtkadjustment container. Upon calling reference back to such widget container without having utilised a type cast transformation back to an originating format type, having stored such value for purposes of memory, could have effects down the road in so far as storage and retrieval later. For example, ran into this problem with regards to initialisation outputs into type cast written strings, however control statement breaking flow of written output to integer types would mean the loss of output data for once integer types now represented as floats, doubles, or other numeric types. Thus moral in story here, pay attention to type casting when passing data between widget data storage containers in pygtk.

No comments:

Post a Comment

Oblivion

 Between the fascination of an upcoming pandemic ridden college football season, Taylor Swift, and Kim Kardashian, wildfires, crazier weathe...