Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: sympy Date: Wed, 30 Mar 2016 22:29:14 +1100 Lines: 29 Message-ID: References: <733f5f0d-9b4e-4023-897b-e1f2730c39cb@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de eqvfQv/XvuCSKv24RHxNnAZIDpRK2r2RV/KyUvIIHxTw== Cancel-Lock: sha1:DVfMYzpL052ybdCeEvAW/f7UqGw= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '*is*': 0.09; 'python:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python.': 0.11; 'instead.': 0.15; '*should*': 0.16; '8bit%:32': 0.16; 'clear.': 0.16; 'doing,': 0.16; 'first:': 0.16; 'intended.': 0.16; 'namespace,': 0.16; 'namespace.': 0.16; 'operators,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'url:pep-0008': 0.16; 'import': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'coding': 0.27; 'culture,': 0.29; 'pep': 0.29; 'spaces': 0.29; 'url:peps': 0.29; 'code': 0.30; 'url:python': 0.33; 'instead,': 0.33; 'qualify': 0.33; 'throughout': 0.34; 'clear': 0.35; 'url:dev': 0.35; 'but': 0.36; 'url:org': 0.36; 'possible': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'detail': 0.38; 'no,': 0.38; 'names': 0.38; 'does': 0.39; 'enough': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'provide': 0.61; 'making': 0.62; 'more': 0.63; 'different': 0.63; 'story': 0.65; 'intent': 0.66; 'results': 0.66; 'skip:\xe2 10': 0.70; 'transfer': 0.73; '_o__)': 0.84; 'history,': 0.84; 'idiomatic': 0.84; 'legend': 0.84; 'received:125': 0.84; 'recurring': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:106052 Poul Riis writes: > Is it possible to transfer results from sympy to 'normal' python. Is Sympy not “normal Python”? What transfer are you intending? > In the case below I think my intention is clear enough but it does not > work as intended. How can it be done? First: no, your intention is not clear. Please write idiomatic Python: spaces around operators, names which describe the meaning. Follow the coding style guide PEP 8 . Second: no, the intent is obscured because you are using ‘from sympy import *’. This clobbers the global namespace, making it much more difficult to tell which names come from a different namespace. Instead, do ‘import sympy’ and qualify names ‘sympy.Symbol’, etc. Third: if the code “does not work as intended”, then the answer can be no better than “change it until it works as intended”. If you want more detail, please provide more detail on what it *is* doing, and what you think it *should* do instead. -- \ “I bet one legend that keeps recurring throughout history, in | `\ every culture, is the story of Popeye.” —Jack Handey | _o__) | Ben Finney