On Sat, Aug 17, 2013 at 10:56 AM, Rathmann <rathmann...@gmail.com> wrote:
> Now that we are on a single code base, I have a few questions on how
> best to write/test code going forward.  In particular, do we have a
> convention on how to handle name changes?
>
> One approach might be to have Sympy's code base reflect one of Python
> 2/3s names/syntax, and adjust as best we can for the other version via
> core/compatability.  I am assuming that is *not* how we are going,
> since we currently have print as a function (hard to avoid that) and
> lots of usage of (version 2) xrange.
>
> My particular issue is with zip (actually izip_longest).  One of my
> test functions depends for correctness on getting the iterator version
> of the zip function.  Since what I really need is izip_longest, I have
> tentatively defined, in compatability, zip_longest, as being the
> either izip_longest or zip_longest as needed.
>
> This works fine, but it would be nice to have some sort of consensus
> guideline on how to handle these going forward.  For example, do we
> have a policy against adding bloat to core/compatibility unless
> absolutely necessary?

It's not bloat to compatibility. It's bloat if you don't add it to
compatibility, because you then have a four line try, except
ImportError in your code instead of one import from compatibility. So
all compatibility code should be put in compatibility.py

As to whether we should use Python 2 names or Python 3 names, I'm not
sure if we agreed upon a convention. My preference would be to use
Python 3 names. Obviously for Python 2 only things like long we have
to use the Python 2 names, for for things like range/xrange or
zip/izip, I think we should use the Python 3 names. It looks like the
file currently uses Python 2 names. I don't feel strongly about it,
though.

print is different because the Python 2 and Python 3 ways are mutually
incompatible with one another, so the only way to be uniform is to use
the Python 3 way in Python 2 by importing print_function from
__future__.

Aaron Meurer

>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to