From eccd55dd6b971c1a488e351072a429045152a48a Mon Sep 17 00:00:00 2001 From: Toomore Chiang Date: Fri, 10 Jan 2014 20:30:18 +0800 Subject: [PATCH] Add assert into realtime. #9 --- grs/realtime.py | 1 + 1 file changed, 1 insertion(+) diff --git a/grs/realtime.py b/grs/realtime.py index 85cc0fe..2615bcf 100644 --- a/grs/realtime.py +++ b/grs/realtime.py @@ -61,6 +61,7 @@ class RealtimeStock(object): crosspic: K線圖 by Google Chart """ def __init__(self, no): + assert isinstance(no, str), '`no` must be a string' self.__raw = '' page = urllib2.urlopen( 'http://mis.tse.com.tw/data/{0}.csv?r={1}'.format(