Javaã ã¨ãããã«ãã¼ã¡ã½ãããstaticã§å®ç¾©ãããã©ãPythonã®å ´åã¯ã§ããã ãã¯ã©ã¹ã¡ã½ããã使ã£ãæ¹ãè¯ãã ããã
ä¾ãã°ãfloat.fromhex http://docs.python.org/library/stdtypes.html#float.fromhex ã¯ã¯ã©ã¹ã¡ã½ãããªã®ã§ã
>>> class Foo(float): ... pass ... >>> foo = Foo.fromhex('0x1p-1') >>> type(foo) <class '__main__.Foo'>
ãã«ãã¼ã¡ã½ãããåã¯ã©ã¹ã§ãå©ç¨ã§ããã
ãã¡ããããã«ãã¼ã¡ã½ãããåã¯ã©ã¹ã§ã妥å½ã§ãããã©ããã¯åã¯ã©ã¹æ¬¡ç¬¬ãªãã ãã©ã妥å½ã§ãªãå ´åã¯åã¯ã©ã¹ã§ãªã¼ãã¼ã©ã¤ããããããã ãã®è©±ãªã®ã§ãåã¯ã©ã¹ã§ã使ããããã«ã¯ã©ã¹ã¡ã½ããã«ãã¦ããã¦æã¯ç¡ãã