poppopjmp / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

Dynamic types can sometimes still be supported #98

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Attempt to shedskin this file:
def first_scope(maybe=True):
    if maybe:
        a=(1.3,'a')
        return 1
    else:
        a=True
        return 1
    a='aoe'
    return 1
if __name__=='__main__':
    print first_scope()

What is the expected output? What do you see instead?

Shedskin throws up on a being a 'dynamic' type:
*WARNING* scope.py: variable (function first_scope, 'a') has dynamic (sub)type: 
{pyseq, bool}

However there are no possible cases where a actually is dynamic. Shedskin could 
instead garble up the name of a so that each instance has a unique name (and 
type) so there are no errors when compiling.

What version of the product are you using? On what operating system?

Shedskin 0.5 on Debian.

Original issue reported on code.google.com by fahh...@gmail.com on 3 Oct 2010 at 10:36

GoogleCodeExporter commented 8 years ago
agreed, shedskin could handle this kind of situation. but again, I'm not sure 
it's worth the complication at this point.. :) it's also usually very easy to 
work around.

Original comment by mark.duf...@gmail.com on 4 Oct 2010 at 8:21

GoogleCodeExporter commented 8 years ago
btw, nice to see you also use dvorak.. ;)

Original comment by mark.duf...@gmail.com on 4 Oct 2010 at 12:34

GoogleCodeExporter commented 8 years ago

Original comment by mark.duf...@gmail.com on 5 Oct 2010 at 2:05

GoogleCodeExporter commented 8 years ago

Original comment by mark.duf...@gmail.com on 27 Oct 2010 at 1:26

GoogleCodeExporter commented 8 years ago
Issue 144 has been merged into this issue.

Original comment by mark.duf...@gmail.com on 13 Jul 2011 at 7:26

GoogleCodeExporter commented 8 years ago
Issue 151 has been merged into this issue.

Original comment by mark.duf...@gmail.com on 27 Aug 2011 at 10:13