Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string': 0.09; 'character,': 0.09; 'closest': 0.09; 'lookup': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:extra': 0.09; 'types:': 0.09; 'python': 0.11; 'bug': 0.12; 'mostly': 0.14; 'accepts': 0.16; 'igor': 0.16; 'integer,': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:variable': 0.16; 'substring': 0.16; 'sat,': 0.16; 'module': 0.19; 'integer': 0.24; 'parse': 0.24; 'url:home': 0.24; 'regardless': 0.24; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'dec': 0.30; 'matching': 0.30; "i'm": 0.30; 'invoke': 0.31; 'option': 0.32; 'becomes': 0.33; 'guess': 0.33; 'actual': 0.34; 'except': 0.35; 'charset:us-ascii': 0.36; 'list.': 0.37; 'received:76': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'subject:" ': 0.39; 'though,': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'identify': 0.61; 'first': 0.61; 'field': 0.63; 'map': 0.64; 'kept': 0.65; 'within': 0.65; 'converters': 0.84; 'float,': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Eliminate "extra" variable Date: Sun, 15 Dec 2013 12:08:15 -0500 Organization: IISS Elusive Unicorn References: <20131208125823.241112db@bigbox.christie.dr> <20131208161858.1365f2d7@bigbox.christie.dr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-23-207.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387127306 news.xs4all.nl 2972 [2001:888:2000:d::a6]:56409 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61956 On Sat, 14 Dec 2013 23:49:58 -0800, Igor Korot declaimed the following: > >So, I guess this is a bug in the sqlite3 python module as datetime is >legal data type on the DB engine. > Note though, SQLite3 only has four native data types: integer, float, character, blob. It accepts almost anything for a type declaration, and will map that to the closest internal format (moreover, it will accept any actual datatype in any actual field -- you can store strings in an integer field unless the string content IS a representation of an integer in which case it is turned to binary). Regardless of how Python stores a date/datetime/time (well, except for the floating point C date/time types), it will mostly be kept as a string representation within SQLite3. It then becomes the responsibility of the converter modules invoked by the parsing option to identify and format the data. I suspect date and datetime both parse into the same converter. I'm not sure how it behaves if one defined converters for date and datetime separately, as I think it uses substring matching to invoke the converter: a type of date and a type of datetime would both match a converter for "date" if the date converter is first in the lookup list. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/