On Mon, 28 Mar 2016 07:49 am, BartC wrote:
> On 27/03/2016 21:32, Tim Chase wrote:
>> On 2016-03-27 14:28, Steven D'Aprano wrote:
>
>>> In this case, the two lines "fnc" and "next" simply look up the
>>> function names, but without actually calling them. They're not
>>> quite "no-ops", since they
On Sat, 26 Mar 2016 23:30:30 +, John Pote wrote:
> So I have sympathy with the OP, I would expect the compiler to pick this
> up
Why? The code is valid, the compiler knows how to generate the
appropriate bytecode for it.
The compiler isn't "lint".
Reporting code which is actually invalid is
On Mon, Mar 28, 2016 at 7:49 AM, BartC wrote:
> On 27/03/2016 21:32, Tim Chase wrote:
>>
>> On 2016-03-27 14:28, Steven D'Aprano wrote:
>
>
>>> In this case, the two lines "fnc" and "next" simply look up the
>>> function names, but without actually calling them. They're not
>>> quite "no-ops", sin
On 27/03/2016 21:32, Tim Chase wrote:
On 2016-03-27 14:28, Steven D'Aprano wrote:
In this case, the two lines "fnc" and "next" simply look up the
function names, but without actually calling them. They're not
quite "no-ops", since they can fail and raise NameError if the name
doesn't exist, bu
On 2016-03-27 14:28, Steven D'Aprano wrote:
> > So intrigued by this question I tried the following
> > def fnc( n ):
> > print "fnc called with parameter '%d'" % n
> > return n
> >
> > for i in range(0,5):
> > if i%2 == 0:
> > fnc
> > next
> > print i
> >
>
On Sun, 27 Mar 2016 10:30 am, John Pote wrote:
> So intrigued by this question I tried the following
> def fnc( n ):
> print "fnc called with parameter '%d'" % n
> return n
>
> for i in range(0,5):
> if i%2 == 0:
> fnc
> next
> print i
>
> and got the same r
On 26/03/2016 23:30, John Pote wrote:
So intrigued by this question I tried the following
def fnc( n ):
print "fnc called with parameter '%d'" % n
return n
for i in range(0,5):
if i%2 == 0:
fnc
next
print i
and got the same result as the OP
A couple of
On 26/03/2016 12:05, Chris Angelico wrote:
On Fri, Mar 25, 2016 at 11:06 PM, Aleksander Alekseev wrote:
Recently I spend half an hour looking for a bug in code like this:
eax@fujitsu:~/temp$ cat ./t.py
#!/usr/bin/env python3
for x in range(0,5):
if x % 2 == 0:
next
print(
On Fri, Mar 25, 2016 at 11:06 PM, Aleksander Alekseev wrote:
> Recently I spend half an hour looking for a bug in code like this:
>
> eax@fujitsu:~/temp$ cat ./t.py
> #!/usr/bin/env python3
>
> for x in range(0,5):
> if x % 2 == 0:
> next
> print(str(x))
>
> eax@fujitsu:~/temp$ ./t
On Fri, 25 Mar 2016 11:06 pm, Aleksander Alekseev wrote:
> Is it possible to make python complain in this case? Or maybe solve
> such an issue somehow else?
This is a job for a "linter", such as pychecker, pylint or pyflakes. Google
for more if you are interested.
A linter will check your code f
On 25/03/2016 12:06, Aleksander Alekseev wrote:
Hello
Recently I spend half an hour looking for a bug in code like this:
eax@fujitsu:~/temp$ cat ./t.py
#!/usr/bin/env python3
for x in range(0,5):
if x % 2 == 0:
next
print(str(x))
eax@fujitsu:~/temp$ ./t.py
0
1
2
3
4
Is it
On 25 March 2016 at 13:06, Aleksander Alekseev wrote:
> Hello
>
> Recently I spend half an hour looking for a bug in code like this:
>
> eax@fujitsu:~/temp$ cat ./t.py
> #!/usr/bin/env python3
>
> for x in range(0,5):
> if x % 2 == 0:
> next
> print(str(x))
>
> eax@fujitsu:~/temp$
On Sat, Mar 26, 2016 at 9:59 AM Aleksander Alekseev
wrote:
> Hello
>
> Recently I spend half an hour looking for a bug in code like this:
>
> eax@fujitsu:~/temp$ cat ./t.py
> #!/usr/bin/env python3
>
> for x in range(0,5):
> if x % 2 == 0:
> next
> print(str(x))
>
> eax@fujitsu:~/
Hello
Recently I spend half an hour looking for a bug in code like this:
eax@fujitsu:~/temp$ cat ./t.py
#!/usr/bin/env python3
for x in range(0,5):
if x % 2 == 0:
next
print(str(x))
eax@fujitsu:~/temp$ ./t.py
0
1
2
3
4
Is it possible to make python complain in this case? Or m
14 matches
Mail list logo