Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'value,': 0.03; 'say,': 0.05; 'function,': 0.07; 'variable,': 0.07; 'python': 0.09; 'c/c++': 0.09; 'object)': 0.09; 'objects.': 0.09; 'useful,': 0.13; 'language': 0.14; 'value.': 0.15; 'adept': 0.16; 'attributes,': 0.16; 'c/c++.': 0.16; 'debugged': 0.16; 'executable.': 0.16; 'googled': 0.16; 'investigate': 0.16; 'program...': 0.16; 'reference).': 0.16; 'later': 0.16; 'wrote:': 0.17; 'passes': 0.17; '(in': 0.18; 'windows': 0.19; 'bit': 0.21; 'object.': 0.22; 'pascal': 0.22; 'references': 0.23; "i've": 0.23; 'pass': 0.25; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; '(which': 0.26; 'values': 0.26; 'ago': 0.27; 'am,': 0.27; 'possibly': 0.27; 'c++': 0.27; 'first.': 0.27; 'argue': 0.29; 'objects': 0.29; 'maybe': 0.29; 'that.': 0.30; 'standards': 0.30; 'function': 0.30; 'error': 0.30; 'distribute': 0.30; 'problem.': 0.32; 'could': 0.32; 'conventions': 0.33; 'function.': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'weeks': 0.33; 'adds': 0.35; 'faster': 0.35; 'doing': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'wanted': 0.36; "i'll": 0.36; 'should': 0.36; 'too': 0.36; 'problems': 0.36; 'ok,': 0.37; 'does': 0.37; 'two': 0.37; 'passed': 0.37; 'usual': 0.37; 'well.': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'google': 0.39; 'received:192.168': 0.40; 'think': 0.40; 'skip:u 10': 0.60; 'most': 0.61; 'telling': 0.61; 'subject:...': 0.63; 'more': 0.63; 'great': 0.64; 'sit': 0.65; 'forward': 0.66; 'finally': 0.66; 'header:Reply-To:1': 0.68; 'fact,': 0.69; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; '(value': 0.84; 'subject:very': 0.91; 'angel': 0.93 Date: Sat, 05 Jan 2013 06:23:22 -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:h10kfFjQgUmI3MfQkDqRSeZZM9rJsDl1bisu6BreRaH ZpNeQAhELheXof76ihCFZ0+wDUTpwu2XY5P4+qc/rEOfaJzxHD FrJjVzP29uSmjTIlpCNCuY7UmcKdPSjRBFvDo2lQjrlnR/jhr2 cgCAkrSjTImwqpD/bBYQPCICm17A0LX+2cYncuz0kvS4MmTElG 3lvr5NZogvwxAK3pi4tG/cWpwH0PD3F4FRUYQsCFqkBxNVy9KK +8E6pEEO7vNrBUW0xHuWbWhkxHFL7rwjsgGyxzdjaq3W1+B1O+ wnIeBWTLOvV8Qjgo0ExwMXvIHbIQG3p6kpDQNCjvWFUTLTGfw= = 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: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357385021 news.xs4all.nl 6909 [2001:888:2000:d::a6]:38208 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36157 On 01/05/2013 05:49 AM, someone wrote: > On 01/05/2013 02:30 AM, Dave Angel wrote: > >> >> Function objects are enormously useful, as you get more adept at using >> Python. > > Ok, I'll look forward to that. Recently I had some problems with > pass-by-value vs pass-by-reference. I googled the problem and found > that by default python passes by reference. Pascal has two calling conventions (value and reference). C always calls by value. C++ adds a call by reference, and maybe later C standards have added it as well. Python always calls by object. In fact, one could argue that there are no values (in the C sense) in Python. All names, and all attributes, and all slots in collections, are references to objects. So when you call a function, what you're doing is telling the function how to reference the same object(s). The usual way to say that is that the function call binds a new name to an existing object. If that object is mutable, then perhaps you wanted to do a copy first. Or perhaps you didn't. As you say, you debugged the program to find out. > I then debugged my program and finally found out that I should make a > copy (a new object) of the variable, before I passed it to my > function. And THIS solved my problem. But in C/C++ I think the default > is to pass by value, so this error in my program was a bit > unexpected... Anyway, I feel python is a great language for doing > things much faster than I could possibly do in C/C++. > > I also have on my todo-list to take my opengl-program and make it into > an executable. I mainly sit on a linux-pc but I want to distribute my > opengl program for windows (which has most users). I've found > something on google for py2app, cx_Freeze, bbfreeze and Freeze and I > hope this cross-platform thing does not cause too many problems... I > tried one of these tools a few weeks ago but I think I only succeeded > with a very simple hello-world program... Anyway, that's a problem > I'll investigate in a few months when I think/hope my opengl program > is finished... > -- DaveA