Movatterモバイル変換
[0]ホーム
[Python-Dev] #pragmas in Python source code
Peter Funkpf@artcom-gmbh.de
Wed, 12 Apr 2000 20:17:25 +0200 (MEST)
Hi![me:]> > This would defeat an important goal: backward compatibility: You> > can't add 'pragma division: old' or something like this to a source> > file, which should be able to run with both Python 1.5.2 and Py3k.> > This would make this mechanism useless for several important> > applications of pragmas. M.-A. Lemburg:> Hmm, I don't get it: these pragmas would set variabels which> make Python behave in a different way -- how do you plan to> achieve backward compatibility here ?>> I mean, u = u"abc" raises a SyntaxError in Python 1.5.2 too...Okay. What I mean is for example changing the behaviour of thedivision operator: if 1/2 becomes 0.5 instead of 0 in some futureversion of Python, it is a must to be able to put in a pragmawith the meaning "use the old style division in this module"into a source file without breaking the usability of this sourcefile on older versions of Python.Regards, Peter-- Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)
[8]ページ先頭