Movatterモバイル変換
[0]ホーム
Adding optional 'explicit' declaration?
Remco Gerlichscarblac at pino.selwerd.nl
Thu Apr 26 08:45:00 EDT 2001
Laurent Pointal <pointal at lure.u-psud.fr> wrote in comp.lang.python:> The idea is to optionnaly allow to force an explicit variable declaration> in Python functions/methods for compilation time check.>> The transparent creation of variables in Python is really nice, but there> are times when it become a bug source, essentially because of misstyping of> variable names.Does anyone have any numbers on this? People make this claim all the time,but in practice my typos are always caught at compile time or immediatetesting already. I believe bugs like this are really rare.Does anyone have numbers from a real project on how many bugs were causedby typos like this? What percentage of all bugs was that?This looks to me like a feature request based on FUD that we're arguingagainst with FUD, some facts would be nice...> What do you think of this?The types-sig is a whole special interest group about this topic.I think that there are many cases in which you can't do the checks atcompile time anyway (libraries that aren't strictly typed, eval()), andeven more cases in which type checking would be bad (passing a UserListinstead of a list). But that's mostly opinion, as I said, facts would be nice.And similar to Alex's excellent rant, I hope people aren't trying to makePython the one language to use for everything...-- Remco Gerlich
More information about the Python-listmailing list
[8]ページ先頭