在各种类型上做.__ class__

时间:2019-10-14 00:02:18

标签: python python-3.x

整数是唯一不支持.__class__操作的类型吗?例如:

>>> ....__class__
<class 'ellipsis'>

>>> 'a'.__class__
<class 'str'>

>>> 2.44.__class__
<class 'float'>

>>> 1.__class__
File "<stdin>", line 1

有没有办法解决这个问题?

1 个答案:

答案 0 :(得分:3)

它受支持,但是DROP Sequence Seed_ID; Create Sequence Seed_ID INCREMENT BY 1 Start with 1; DECLARE fw UTL_FILE.FILE_TYPE; fr UTL_FILE.FILE_TYPE; textOut Varchar2(2000); ----Store All txt file Seed_word Varchar2(2000); -----Seed words store i number; -----Incramenter for Category ID match_var VARCHAR(255); ---Use to mathc the category with seed words mvi number; -- match var incramenter BEGIN fr := UTL_FILE.FOPEN('FILE_READ_WRITE', 'seed.txt', 'r'); fw := UTL_FILE.FOPEN('FILE_READ_WRITE', 'seed2.csv', 'w'); LOOP BEGIN i :=1; mvi := 1; UTL_FILE.GET_LINE(fr,textOut); match_var := REGEXP_SUBSTR (textOut, '[^,]+' ,1,1); --- gets first word in each line UPDATE Category2 ---Should this insert the values int the Category tablE?????????? SET Category_ID= mvi, Category_name= textout WHERE mvi = CATEGORY_ID; mvi := mvi+1; WHILE TRUE LOOP BEGIN Seed_word := REGEXP_SUBSTR (textOut, '[^,]+' ,1,i+1); i := i+1; EXIT WHEN seed_word IS NULL; UTL_FILE.PUT_LINE(fw,Seed_ID.nextval ||','||Seed_word||','||mvi); END; END LOOP; END; END LOOP; EXCEPTION WHEN OTHERS THEN dbms_output.put_line(SQLERRM); UTL_FILE.FCLOSE(fr); UTL_FILE.FCLOSE(fw); END; 被解析为浮点文字。

  

有没有办法解决这个问题?

是的,有几种方法:

1.