On Friday, November 23, 2012 2:41:36 AM UTC-7, Aaron Meurer wrote: > > On Thu, Nov 22, 2012 at 6:28 PM, David Li <li.da...@gmail.com<javascript:> > > wrote: > >> What exactly was the tuple before? >>> >> >> The tuple before was (auto_symbol, auto_number, factorial_notation). >> The new function that replaces the tuple iterates through those functions >> internally and applies each of them. >> > > I like the API the way it currently is. You are adding transformers to > the standard transformers. If you want, you can modify the standard > transformers. This cannot be done with your suggested change. > >
Alright, I'll revert that change. > >> >> >>> Did you also fix comment 3 of 2663? >>> >> >> I added those cases as tests, actually. >> >> >>> Can you make your fix generalized to an API? I need this exact same fix >>> to change isympy -a to use parsing. >>> >>> >> Can you clarify? So you want the fix refactored by itself? I'm not sure >> if that warrants a separate function, the change is simply (while iterating >> through the tokens) >> >> if (# Don't convert attribute access >> (prevTok[0] == OP and prevTok[1] == '.') or >> # Don't convert keyword arguments >> (prevTok[0] == OP and prevTok[1] in ('(', ',') >> and nextTokNum == OP and nextTokVal == '=')): >> > > Does that also include things like += ? > I thought sympify didn't handle statements, only expressions? David > > >> # Don't insert call to Symbol >> else: >> # Insert call to Symbol >> > > Actually, I guess it won't be that simple, because I have to do it with > ast, not tokenize. See https://github.com/ipython/ipython/pull/2301 (and > my work so far at https://github.com/asmeurer/sympy/tree/ast). If you > play with that branch, you'll see that isympy -a is broken, because it > tries to transform stuff to Symbol() that it shouldn't. > > But I guess there are just these three cases where a name cannot be > wrapped in Symbol(): The name is the left-hand side of an assignment, the > name is a attribute, or the name is a keyword argument (this is assuming > that we already know from the parser that it is indeed a name and not a > literal or a keyword). We might want to examine the grammer specification > to convince ourselves that these are indeed the only cases. > > Aaron Meurer > > >> >> I'll put up a pull request soon. >> >> David >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/sympy/-/HRg1zva3LesJ. >> >> To post to this group, send email to sy...@googlegroups.com <javascript:> >> . >> To unsubscribe from this group, send email to >> sympy+un...@googlegroups.com <javascript:>. >> For more options, visit this group at >> http://groups.google.com/group/sympy?hl=en. >> > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/YJYyUzsxj20J. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.