TypeScript or JavaScript type casting

How does one handle type casting in TypeScript or Javascript? Say I have the following TypeScript code: module Symbology { export class SymbolFactory { createStyle( symbolInfo : SymbolInfo) : any { if (symbolInfo == null) { return null; } if (symbolInfo.symbolShapeType === “marker”) { // how to cast to MarkerSymbolInfo return this.createMarkerStyle((MarkerSymbolInfo) symbolInfo); } } … Read more

In Python, how do I convert all of the items in a list to floats?

I have a script which reads a text file, pulls decimal numbers out of it as strings and places them into a list. So I have this list: my_list = [‘0.49’, ‘0.54’, ‘0.54’, ‘0.55’, ‘0.55’, ‘0.54’, ‘0.55’, ‘0.55’, ‘0.54’] How do I convert each of the values in the list from a string to a … Read more