View Full Version : Doesn't catch duplicate function names
joecool
08-05-2009, 03:27 PM
I noticed today that Portal 2.2 Beta doesn't warn you if you have two functions with the same name. I was copying and pasting some functions and forgot to rename one of them. Typical dumb mistake, but I was surprised I got no warnings.
Jheath
08-06-2009, 09:37 AM
Yep. Sure enough.
It appears that SNAPpy will use whichever version of the function is defined last (ie. the highest line number of the file).
We'll add that to the list for the next release.
Thanks Mr. Cool.
mgenti
08-06-2009, 09:42 AM
Just for reference, this is also how desktop python behaves if you define a function more than once.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.