我的问题是为什么MySQL行的整数值后缀为'L'?以下是详细信息:
以下词典 - 为了便于展示而人为地格式化 -
{'estimated': '',
'suffix': '',
'typeofread': 'g',
'acct_no': 901001000L,
'counter': 0,
'time_billed': datetime.datetime(2012, 5, 1, 9, 5, 33),
'date_read': datetime.datetime(2012, 3, 13, 23, 19, 45),
'reading': 3018L,
'meter_num': '26174200'}
Run Code Online (Sandbox Code Playgroud)
由一个MySQL数据库表的列压缩而成,其中包含从表中读取一次的结果.
我可以通过将这些值传递给int()来删除'L',所以如果该字典位于名为snapped_read的变量中,我可以这样做:
int(snapped_read['reading'])并将3018L改为3018.
我只是好奇为什么整数会以这种方式出现.