2 ms·
One more for the list, and my all-time most hated Python annoyance: No equivalent of Perl's "use strict vars". In other words... blah = 1 if foo:
by raldi 8y ago
One more for the list, and my all-time most hated Python annoyance: No equivalent of Perl's "use strict vars". In other words...
blah = 1
if foo:
balh = 2
print blah
...doesn't let me know I've made a typo the way the equivalent Perl would:
my $blah = 1;
if ($foo)
$balh = 2;
print $blah;
Which outputs the following even without "use strict vars":
Name "main::balh" used only once: possible typo
And if you turn that on (like all Perl programmers have, in all their programs, for decades):
Global symbol "$balh" requires explicit package name
- mixmastamyk 8y agoYa know this isn't a bad idea to float on python-ideas. I first thought pyflakes would flag it, but it doesn't. Don't think it would hard to implement a warning, without need for strict, as python already spits various warnings when given non-optimal code.