Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44550

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.057
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'syntax': 0.04; 'debug': 0.07; 'python': 0.11; '-------': 0.16; 'octal': 0.16; 'overriding': 0.16; 'permissions,': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '>>>': 0.22; 'code,': 0.22; 'header :User-Agent:1': 0.23; '2.x': 0.24; 'source': 0.25; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'leave': 0.29; 'am,': 0.29; 'unix': 0.29; 'file': 0.32; 'supposed': 0.32; 'checking': 0.33; 'guess': 0.33; 'sense': 0.34; "i'd": 0.34; 'equal': 0.35; 'there': 0.35; 'error.': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'dave': 0.60; 'most': 0.60; 'course': 0.61; 'invalid': 0.68; 'received:74.208': 0.68; 'comment.': 0.84; 'received:74.208.4.194': 0.84; 'surround': 0.84; 'angel': 0.91; '2013': 0.98
Date Tue, 30 Apr 2013 11:58:33 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version 1.0
To python-list@python.org
Subject Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.
References <ad277b74-0fbd-456d-915e-e87743dc16df@googlegroups.com> <517FE68A.1000703@davea.name> <CAPTjJmp9_Mc+uhP3n1DsSLUpo4=81xo4Qv-5zLj3K_qD=AwfXA@mail.gmail.com>
In-Reply-To <CAPTjJmp9_Mc+uhP3n1DsSLUpo4=81xo4Qv-5zLj3K_qD=AwfXA@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:BuQM3Mpl4JMefY8s59P1gk0mkRr3QEvLq84IuvYMAZf P8vYomPAOncK/oDtHz0lOV2ea02qifF7cB6xlm0+E/RaBYSgec cKvwrC5/ejHwm9dKexcd4IIJDjzT8sqSSag8x7GlMKw2NNuZfT JahUnTJRZMLubzns4hr65qi9W3eB1WZRSnjWf/W5HJOu8XyJ1V UE0BsFVrBG6HQ5iZY0UW738rtxmxNP9549Wrv/7wVrCZTEUjdP W5Qhho5dxWidfN9OtgLJdF0PS29I2OKEQpCevVvG2UjBW3Ekig EsGZuvVUjzOptCtla4c73GGF4XH8Za+UxtnDJcXExe0c0PzKQ= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1183.1367337534.3114.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367337534 news.xs4all.nl 15953 [2001:888:2000:d::a6]:58928
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44550

Show key headers only | View raw


On 04/30/2013 11:49 AM, Chris Angelico wrote:
> On Wed, May 1, 2013 at 1:43 AM, Dave Angel <davea@davea.name> wrote:
>> On 04/30/2013 11:27 AM, tromeo@mdlogix.com wrote:
>>>
>>>
>>> Please help me to debug
>>>
>>> -------
>>> shmid = shmget(SHM_KEY, SHM_SIZE, 0o666)
>>>                                                                      ^
>>> SyntaxError: invalid syntax
>>>
>>
>> 0o666 is indeed a syntax error.  What is that value supposed to be?  If it's
>> intended to be an int that's equal to octal 666, just use 438
>
> Without checking docs, I would guess that to be Unix file permissions,
> which make most sense in octal.
>
>

So put the octal description in the comment.  I think the Python 2.x 
syntax for octal is a travesty.  And of course it's non-portable to 
Python 3.  I would not intentionally leave 0666 in my source code, 
unless there was some other overriding reason for it.  And then I'd 
surround it with snide remarks.


-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. tromeo@mdlogix.com - 2013-04-30 08:27 -0700
  Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Joel Goldstick <joel.goldstick@gmail.com> - 2013-04-30 11:36 -0400
  Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Chris Angelico <rosuav@gmail.com> - 2013-05-01 01:37 +1000
    Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Tony Romeo <tromeo@mdlogix.com> - 2013-04-30 08:52 -0700
      Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Chris Angelico <rosuav@gmail.com> - 2013-05-01 01:58 +1000
  Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Dave Angel <davea@davea.name> - 2013-04-30 11:43 -0400
  Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Chris Angelico <rosuav@gmail.com> - 2013-05-01 01:49 +1000
  Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Dave Angel <davea@davea.name> - 2013-04-30 11:58 -0400
  Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Chris Angelico <rosuav@gmail.com> - 2013-05-01 02:06 +1000
    Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Tony Romeo <tromeo@mdlogix.com> - 2013-04-30 11:10 -0700
      Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error. Chris Angelico <rosuav@gmail.com> - 2013-05-01 07:51 +1000

csiph-web