Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feed.xsnews.nl!border-1.ams.xsnews.nl!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'compiler': 0.05; 'reason,': 0.07; 'rewrite': 0.07; 'trailing': 0.07; 'api': 0.09; 'python': 0.09; 'imports': 0.09; 'migration': 0.09; 'useful,': 0.13; 'value.': 0.15; 'adept': 0.16; 'backward': 0.16; 'colons': 0.16; 'lookups': 0.16; 'parentheses': 0.16; 'statements,': 0.16; 'typo': 0.16; 'wxpython': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'version.': 0.17; 'previously': 0.18; 'mostly': 0.20; 'bit': 0.21; 'import': 0.21; 'meant': 0.21; 'names.': 0.22; 'this:': 0.23; 'allows': 0.25; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '(which': 0.26; 'wrote': 0.26; 'fit': 0.26; 'mike': 0.27; 'older': 0.27; 'c++': 0.27; 'forgot': 0.27; 'object,': 0.27; 'interface': 0.27; "doesn't": 0.28; 'attempting': 0.29; 'cases.': 0.29; 'pointer.': 0.29; 'statements': 0.29; 'no,': 0.29; 'objects': 0.29; 'class': 0.29; "i'm": 0.29; 'maybe': 0.29; 'function': 0.30; 'error': 0.30; 'code': 0.31; 'gets': 0.32; 'could': 0.32; 'to:addr :python-list': 0.33; 'likely': 0.33; 'or,': 0.34; 'needed': 0.35; 'friends,': 0.35; 'doing': 0.35; 'pm,': 0.35; 'sometimes': 0.35; 'too.': 0.35; 'something': 0.35; 'there': 0.35; 'add': 0.36; 'really': 0.36; 'tool': 0.36; 'but': 0.36; "didn't": 0.36; "i'll": 0.36; 'ok,': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'things': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'little': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'think': 0.40; 'your': 0.60; 'easy': 0.60; 'most': 0.61; 'remove': 0.61; 'real': 0.61; 'between': 0.63; 'subject:...': 0.63; 'more': 0.63; 'making': 0.64; 'here': 0.65; 'legal': 0.65; 'learned': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'calls,': 0.84; 'compliance,': 0.84; 'confusing': 0.84; 'me).': 0.84; 'received:74.208.4.194': 0.84; 'semi': 0.84; 'closer.': 0.91; 'subject:very': 0.91 Date: Fri, 04 Jan 2013 20:30:47 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: pygame - importing GL - very bad... References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:V120boB75ZRoZdatVByOccM6NvsLGBdxeFwDpygYae2 Ao9hFOblhjNaY4sllBrptk5Pbzu2Q8yzNIjZaXN5Ad9rM6gYsa SdfkwazKA3sLI/sksp8hUFY+apLFPn1sngdsYMynmAFpXmJowe arK9ladvICpdWo9QyHe16jyuUcDXqAewLhGk5ojKafAnBDtjUz Vluz+YI8HmfXpbcgaX2XWYsDg+2viNnteXx0cfiWY44jLNHpuF oVW4YntkN9R4hlgUWh+SUMYQKdNyIs74Ou0ZevkUdT3nFQieQm vqDpchKsCBbSRjkT19X0JxQ9g527M00jmQXQuqWWc+OA40MyQ= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 74 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357349785 news.xs4all.nl 6879 [2001:888:2000:d::a6]:40610 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36148 On 01/04/2013 08:10 PM, someone wrote: > On 01/03/2013 03:09 PM, Mike C. Fletcher wrote: >> > >> PyOpenGL's current approach is mostly attempting to maintain backward >> compatibility with the older revisions. wxPython actually rewrote its >> whole interface to go from * imports into namespaced lookups and then >> wrote a little migration tool that would attempt to rewrite your code >> for the new version. They also provided a transitional API so that code >> could mix-and-match the styles. For PyOpenGL that would look something >> like this: >> >> from OpenGL import gl, glu, glut >> >> gl.Rotate(...) >> gl.Clear(gl.COLOR_BUFFER_BIT) > > Ok, that's interesting. However, I like it the way it is, where I can > copy/paste C-code from the web and change some small things and it'll > work and fit into my needs. BUT I didn't know there was such a > transitional API - interesting. I however don't want to be a > first-mover - let's see if sufficiently many people will use this and > then I'll consider doing it too. At the moment, I still think the > star-import is good because it makes it easy to look for C-code and > program it (=do it) like people would do it in C. > >> or, if you really needed PEP-8 compliance, and don't mind making the API >> look nothing like the original, we might even go to: >> >> from opengl import gl, glu, glut >> >> gl.rotate(...) >> gl.clear(gl.COLOR_BUFFER_BIT) > > Erhm, that's the same as above. Is that what you meant to write? > No, it's not the same; here he did not capitalize the function names. Previously they look like class instantiations. > > > Well, I'm sometimes a bit annoyed that python doesn't give as many > warnings/errors as one gets in C - for instance sometimes I copy/paste > and forget to remove the trailing semi-colons. Trailing semi colons are legal in most cases. The semi-colon is a separator between statements, when one wants to put multiple statements on one line. > However after I began to use pylint and friends, this error will be > caught. Then sometimes I forgot to add () for function calls, which in > C would cause an error by the compiler Actually no. In C, a function name without parentheses is also a function pointer. Not exactly the same as a function object, though C++ gets a lot closer. But the real reason C catches that typo is that the types most likely don't match, depending on what you meant to do with the return value. > but which python allows so one can get the object (which maybe is also > a good reason, but at least in the beginning when I learned python, > this was very annoying + confusing to me). > Function objects are enormously useful, as you get more adept at using Python. -- DaveA