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


Groups > comp.lang.python > #88203

Re: VB/Pascal with statement [was Re: Proposal for new minor syntax]

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'advocate': 0.07; 'attribute': 0.07; 'subject: [': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'notation,': 0.16; 'url:faq': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'proposed': 0.22; 'cc:addr:python.org': 0.22; 'faq': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'implicit': 0.31; 'pascal': 0.31; 'steven': 0.31; 'another': 0.32; 'url:python': 0.33; 'subject:with': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'url:org': 0.36; 'subject:new': 0.38; 'improving': 0.38; 'subject:]': 0.38; 'pm,': 0.38; 'that,': 0.38; 'does': 0.39; 'dont': 0.67; 'mar': 0.68; '2015': 0.84; 'do:': 0.91; 'eliminates': 0.91; 'proposal,': 0.91; 'subject:Proposal': 0.91; 'to:none': 0.92
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=1OoQyIjGGfRJRINu2AZYmIu1SvhUGnKYEzvOKqHqbbc=; b=NkyjC4DCMhCyeuLhmBXlV1qe2Ou6gs+KCeU5rcr6o4DRN9sTORGdJi0FPggF30TIsP kaYAkxROXCX5wMzOAeowE1PG/hda4Af7HaqqAWUyZIDLfvK5+fUHcfclf3GaF5walyq5 gg59jwYn2sutYyqhLoPVL9scyyqI1XS9lBn6QfZ2cCiUaJuZuiefaf13L6ZDH6CNMkMx Ba3gqei9Lo0cb33veXW5tXJrRtuEtXF0ZG/m8JY0ri+ihEGnQLygY/Q/eHKQj42IXUSw c7U1J8shFxa0OdiO6KzpsRv679B/a2BkUGBurfi83IztYESJ5uLTHwphbmiRkwTwUqwp jCSQ==
MIME-Version 1.0
X-Received by 10.50.61.175 with SMTP id q15mr3575031igr.34.1427524801451; Fri, 27 Mar 2015 23:40:01 -0700 (PDT)
In-Reply-To <5516498e$0$13014$c3e8da3$5496439d@news.astraweb.com>
References <CAPauRLMMAT-OffHTYW6GPybAZzouc7H9BjrmvVQiSig0X3x+ig@mail.gmail.com> <mailman.282.1427499534.10327.python-list@python.org> <ptrbha1f8b7rgjoo3idtflpg3fsrtmvs9t@4ax.com> <mailman.283.1427504164.10327.python-list@python.org> <9c9703b6-cfa6-4e91-900e-3a401562cb9e@googlegroups.com> <5516498e$0$13014$c3e8da3$5496439d@news.astraweb.com>
Date Sat, 28 Mar 2015 17:40:01 +1100
Subject Re: VB/Pascal with statement [was Re: Proposal for new minor syntax]
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.19
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.285.1427524804.10327.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1427524804 news.xs4all.nl 2877 [2001:888:2000:d::a6]:49056
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:88203

Show key headers only | View raw


On Sat, Mar 28, 2015 at 5:26 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> On Sat, 28 Mar 2015 03:18 pm, Rustom Mody wrote:
>
>> One thing that is a bit laborious in python are object initializers:
>>
>> self.attr1 = field1
>> self.attr2 = field2
>>
>> In VB one can do:
>>
>> with self
>> .attr1 = field1
>> .attr2 = field2
>>
>> (or something like that -- dont exactly remember the syntax)
>
>
> Pascal is another language with a construct like that, and there's a FAQ for
> it:
>
> https://docs.python.org/2/faq/design.html#why-doesn-t-python-have-a-with-statement-for-attribute-assignments

While I don't advocate the proposal, it does have an important
difference from the one cited in the FAQ - albeit a Tim-grit
difference: the Pascal version has implicit attribute notation, where
the proposed has a leading dot. This eliminates the ambiguity, though
without majorly improving readability.

ChrisA

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


Thread

Re: Proposal for new minor syntax Ben Finney <ben+python@benfinney.id.au> - 2015-03-28 10:39 +1100
  Re: Proposal for new minor syntax Mario Figueiredo <marfig@gmail.com> - 2015-03-28 01:33 +0100
    Re: Proposal for new minor syntax Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-27 18:55 -0600
      Re: Proposal for new minor syntax Rustom Mody <rustompmody@gmail.com> - 2015-03-27 21:18 -0700
        VB/Pascal with statement [was Re: Proposal for new minor syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-28 17:26 +1100
          Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Chris Angelico <rosuav@gmail.com> - 2015-03-28 17:40 +1100
          Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-28 12:26 +0000
            Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-28 23:58 +1100
              Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-28 13:44 +0000
          Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Rustom Mody <rustompmody@gmail.com> - 2015-03-28 09:21 -0700
            Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Rustom Mody <rustompmody@gmail.com> - 2015-03-28 09:32 -0700
        Re: Proposal for new minor syntax Giorgos Tzampanakis <giorgos.tzampanakis@gmail.com> - 2015-04-08 22:11 +0000

csiph-web