Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Problems using struct pack/unpack in files, and reading them. Date: Sat, 14 Nov 2015 09:42:10 +1100 Lines: 22 Message-ID: References: <20151113192045.GA9913@z-sverige.nu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 1U4qmDul/A1QtO+hkygCMQ5osdBzQrdPFb+8tZZlok2w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operand': 0.07; 'cc:addr :python-list': 0.09; 'subject:files': 0.09; 'subject:using': 0.09; 'cc:name:python': 0.16; 'err,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'operators,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Problems': 0.16; 'unary': 0.16; 'wrote:': 0.16; '>>>': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'meant': 0.22; 'fine,': 0.22; 'am,': 0.23; 'sat,': 0.23; 'sets': 0.23; 'header :In-Reply-To:1': 0.24; 'points': 0.27; 'message- id:@mail.gmail.com': 0.27; '14,': 0.27; 'separated': 0.29; 'spaces': 0.29; 'subject:/': 0.30; 'probably': 0.31; 'received:google.com': 0.35; 'nov': 0.35; 'received:209.85': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'easily': 0.39; 'caused': 0.61; 'no.': 0.62; 'more': 0.63; 'chrisa': 0.84; 'subject:pack': 0.84; 'to:none': 0.91; 'write:': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=N7buyXjesGI245QkWZofr+jv9D4OsiIJC+TuDzeRyjY=; b=I/EjtZpzNisk9yZ6YFeA6XB4XQVKSL2nVmG7/gDvDZtjzk3hqM744DaD6B0bJ9fGcl UaMsqlX4ZFCu3HVMKi6VG+NXZQFEDlaRNeQMunGUTj7CU2JVTdxHM46mHRhnilCLdZLw l5GQ5MaWHVZKXxkuuGgZgpSUmEFk4XqyPUHx3uNBbGvJDMST87ZmVzMa30vDWa8geYx1 VZ3ch2JpZtTvR+BXFUJ3dRXq9R/SkHl56Z0jvn8sWZQF/nRcQwAHcrYvbxqbNDcie9BZ FKIa1ZFMMWKAirQ+94bb5iKzFy2AvrqIfR+6M9i5hSwdXd959P7UykjkyJWh9kzIv6Xx s4mQ== X-Received: by 10.50.83.38 with SMTP id n6mr6239066igy.92.1447454530302; Fri, 13 Nov 2015 14:42:10 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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:98777 On Sat, Nov 14, 2015 at 6:45 AM, Ian Kelly wrote: > This sets RegisterAX to 2. Specifically, positive 2. If you want to > *add* 2, you probably meant to write: > > RegisterAX += 2 > > This also points out a good reason for using spaces around operators, > as "RegisterAX =+ 2" would have caused a SyntaxError and been more > easily detectable. Err, no. Even with spaces, it works just fine, because unary plus is allowed to be separated from its operand with spaces: >>> x=1 >>> x =+ 2 >>> x = + 3 >>> x 3 However, this is a reasonable call for the abolition of unary plus... ChrisA