VanL / shedskin

Shed Skin is an experimental compiler, that can translate pure, but implicitly statically typed Python (2.4-2.6) programs into optimized C++
0 stars 1 forks source link

non-simple class-level assignment #125

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

class MyClass(object):
    A, B, C = range(3)

What is the expected output?

The code successfully compiles in ShedSkin, and produces the same output as the 
following code (which does compile successfully):

class MyClass(object):
    A = 0
    B = 1
    C = 2

What do you see instead?

Error message: "at the class-level, only simple assignments are supported"

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

ShedSkin 0.7, compiled from source on Ubuntu 10.10.

Original issue reported on code.google.com by th.perl@gmail.com on 18 Dec 2010 at 4:52

GoogleCodeExporter commented 9 years ago
Type should be enhancement, not defect.

Original comment by th.perl@gmail.com on 18 Dec 2010 at 4:53

GoogleCodeExporter commented 9 years ago
thanks! I'm not sure exactly what causes this restriction, but I will have a 
look for 0.8 to see if this can be improved a bit..

Original comment by mark.duf...@gmail.com on 18 Dec 2010 at 5:21

GoogleCodeExporter commented 9 years ago

Original comment by mark.duf...@gmail.com on 18 Dec 2010 at 5:21

GoogleCodeExporter commented 9 years ago
sorry, this didn't make it in for 0.8.. I hope to get to it at some point, but 
since it gives a clear warning and is very easy to work around, you'll have to 
forgive me it doesn't have much priority.. :-)

Original comment by mark.duf...@gmail.com on 25 May 2011 at 7:47

GoogleCodeExporter commented 9 years ago
I just made some changes for 0.9.3 which should improve the situation 
dramatically for arbitrary code at the 'class-level'. this case at least now 
also works.leaving the issue open for now because I want to try and completely 
eliminate above mentioned error message before 0.9.3, within the next few days 
hopefully. thanks again in any case for reporting!

Original comment by mark.duf...@gmail.com on 5 Jan 2013 at 5:05

GoogleCodeExporter commented 9 years ago
okay, the error resided in some dead code, so it was easy to remove.. :)

closing this one then, thanks again for reporting!

Original comment by mark.duf...@gmail.com on 5 Jan 2013 at 9:35

GoogleCodeExporter commented 9 years ago

Original comment by mark.duf...@gmail.com on 5 Jan 2013 at 9:37