IronPython error related to long boolean expressions?

It seems like something funny is going on here. Using IronPython 2.6.2 for .NET 4.0, I get the following behavior. The simplest case is as follows:

  • I am launching an interactive shell
  • I type the next line 5 times

    False or False or False or False or False or False or \
    
  • Then I end it with the next line

    False or False or False or False or False or False
    

As I type this, the process ran 30 minutes of the processor on a pretty good desktop and still doesn't return.

If I reduce step 2 by 1, that is, it has a row 4 times, then it returns in about a minute or two.

If I decrease step 2 by 2, i.e. have a line 3 times, then it returns after about a second or so.

So what is happening and why?

Of course, the real world example that made me isolate this is much more complex and not so frivolous.

Thanks Akil

+3
1

CodePlex. , , IronPython OrExpression AST node . . , OrExpression - . 2- , . OrExpression.cs :

return _left.Type == _right.Type ? _left.Type : typeof(object);

Type lType = _left.Type;
return lType == _right.Type ? lType : typeof(object);

.

+1

Source: https://habr.com/ru/post/1783957/


All Articles