On Apr 15, 2009, at 7:24 AM, Dag Sverre Seljebotn wrote:

> Robert Bradshaw wrote:
>> Unless something is horribly broken, I will release in the next  
>> day  or two.
>> http://cython.org/Cython-0.11.1.rc1.tar.gz
>
> I know it is late (sorry!), but I just remembered some changes to  
> directives behaviour which I'd like to get in; emitting a warning  
> for change of behaviour in 0.12. I think they're rather safe, but  
> I'll definitely take no for an answer.

The warning looks like it'd be fine to slip in at the last moment,  
but I'm not as sure about removing the -X option--perhaps a warning  
about that would be in order though.

> Attaching a patch as I don't want to disturb the freeze (tell me  
> and I'll push).
>
> -- 
> Dag Sverre
>
>
> # HG changeset patch
> # User Dag Sverre Seljebotn <[email protected]>
> # Date 1239804937 -7200
> # Node ID c8d2f8143120ecc3efd1e20d675b26a55e5c8684
> # Parent  d22204d89cfdbdfa05e2f191b7a1b33d2aaa6dc2
> Add warning in situations where command line directive behaviour  
> will change in 0.12
>
> diff -r d22204d89cfd -r c8d2f8143120 Cython/Compiler/ 
> ParseTreeTransforms.py
> --- a/Cython/Compiler/ParseTreeTransforms.py    Wed Apr 15 15:53:26  
> 2009 +0200
> +++ b/Cython/Compiler/ParseTreeTransforms.py    Wed Apr 15 16:15:37  
> 2009 +0200
> @@ -332,13 +332,20 @@ class InterpretCompilerDirectives(Cython
>
>      def __init__(self, context, compilation_option_overrides):
>          super(InterpretCompilerDirectives, self).__init__(context)
> -        self.compilation_option_overrides =  
> compilation_option_overrides
> +        self.compilation_option_overrides = {}
> +        for key, value in compilation_option_overrides.iteritems():
> +            self.compilation_option_overrides[unicode(key)] = value
>          self.cython_module_names = set()
>          self.option_names = {}
>
>      # Set up processing and handle the cython: comments.
>      def visit_ModuleNode(self, node):
>          options = copy.copy(Options.option_defaults)
> +        for key, value in  
> self.compilation_option_overrides.iteritems():
> +            if key in node.option_comments and node.option_comments 
> [key] != value:
> +                warning(node.pos, "Compiler directive differs  
> between environment and file header; this will change "
> +                        "in Cython 0.12. See http:// 
> article.gmane.org/gmane.comp.python.cython.devel/5233", 2)
> +                break
>          options.update(node.option_comments)
>          options.update(self.compilation_option_overrides)
>          self.options = options
> # HG changeset patch
> # User Dag Sverre Seljebotn <[email protected]>
> # Date 1239803606 -7200
> # Node ID d22204d89cfdbdfa05e2f191b7a1b33d2aaa6dc2
> # Parent  bbf007cb50f57bcf0c010661e66b883191958aa3
> Make -X cmdline switch apply to directives, as help text says
>
> diff -r bbf007cb50f5 -r d22204d89cfd Cython/Compiler/CmdLine.py
> --- a/Cython/Compiler/CmdLine.py        Wed Apr 15 00:27:57 2009 -0700
> +++ b/Cython/Compiler/CmdLine.py        Wed Apr 15 15:53:26 2009 +0200
> @@ -79,7 +79,7 @@ def parse_command_line(args):
>                  options.use_listing_file = 1
>              elif option in ("-C", "--compile"):
>                  options.c_only = 0
> -            elif option in ("-X", "--link"):
> +            elif option in ("--link"):
>                  options.c_only = 0
>                  options.obj_only = 0
>              elif option in ("-+", "--cplus"):
>
>
>
>
> # HG changeset patch
> # User Dag Sverre Seljebotn <[email protected]>
> # Date 1239804937 -7200
> # Node ID c8d2f8143120ecc3efd1e20d675b26a55e5c8684
> # Parent  d22204d89cfdbdfa05e2f191b7a1b33d2aaa6dc2
> Add warning in situations where command line directive behaviour  
> will change in 0.12
>
> diff -r d22204d89cfd -r c8d2f8143120 Cython/Compiler/ 
> ParseTreeTransforms.py
> --- a/Cython/Compiler/ParseTreeTransforms.py  Wed Apr 15 15:53:26  
> 2009 +0200
> +++ b/Cython/Compiler/ParseTreeTransforms.py  Wed Apr 15 16:15:37  
> 2009 +0200
> @@ -332,13 +332,20 @@ class InterpretCompilerDirectives(Cython
>
>      def __init__(self, context, compilation_option_overrides):
>          super(InterpretCompilerDirectives, self).__init__(context)
> -        self.compilation_option_overrides =  
> compilation_option_overrides
> +        self.compilation_option_overrides = {}
> +        for key, value in compilation_option_overrides.iteritems():
> +            self.compilation_option_overrides[unicode(key)] = value
>          self.cython_module_names = set()
>          self.option_names = {}
>
>      # Set up processing and handle the cython: comments.
>      def visit_ModuleNode(self, node):
>          options = copy.copy(Options.option_defaults)
> +        for key, value in  
> self.compilation_option_overrides.iteritems():
> +            if key in node.option_comments and node.option_comments 
> [key] != value:
> +                warning(node.pos, "Compiler directive differs  
> between environment and file header; this will change "
> +                        "in Cython 0.12. See http:// 
> article.gmane.org/gmane.comp.python.cython.devel/5233", 2)
> +                break
>          options.update(node.option_comments)
>          options.update(self.compilation_option_overrides)
>          self.options = options
> # HG changeset patch
> # User Dag Sverre Seljebotn <[email protected]>
> # Date 1239803606 -7200
> # Node ID d22204d89cfdbdfa05e2f191b7a1b33d2aaa6dc2
> # Parent  bbf007cb50f57bcf0c010661e66b883191958aa3
> Make -X cmdline switch apply to directives, as help text says
>
> diff -r bbf007cb50f5 -r d22204d89cfd Cython/Compiler/CmdLine.py
> --- a/Cython/Compiler/CmdLine.py      Wed Apr 15 00:27:57 2009 -0700
> +++ b/Cython/Compiler/CmdLine.py      Wed Apr 15 15:53:26 2009 +0200
> @@ -79,7 +79,7 @@ def parse_command_line(args):
>                  options.use_listing_file = 1
>              elif option in ("-C", "--compile"):
>                  options.c_only = 0
> -            elif option in ("-X", "--link"):
> +            elif option in ("--link"):
>                  options.c_only = 0
>                  options.obj_only = 0
>              elif option in ("-+", "--cplus"):
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to