Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #88223
| Path | csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| 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; 'win32': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject: [': 0.09; 'python': 0.11; 'language.': 0.14; 'nameerror:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'url:faq': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'feb': 0.22; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'faq': 0.24; '(or': 0.24; 'subject:/': 0.26; 'defined': 0.27; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'skip:( 20': 0.30; '"",': 0.31; "d'aprano": 0.31; 'pascal': 0.31; 'steven': 0.31; 'file': 0.32; 'another': 0.32; 'url:python': 0.33; '(most': 0.33; 'subject:with': 0.35; 'something': 0.35; 'url:org': 0.36; 'subject:new': 0.38; 'subject:]': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'that,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'name': 0.63; 'our': 0.64; 'more': 0.64; 'charset:windows-1252': 0.65; 'dont': 0.67; 'mar': 0.68; '2015': 0.84; 'received:89': 0.85; 'do:': 0.91; 'subject:Proposal': 0.91 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
| Subject | Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] |
| Date | Sat, 28 Mar 2015 12:26:43 +0000 |
| 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> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | host-89-240-175-14.as13285.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
| In-Reply-To | <5516498e$0$13014$c3e8da3$5496439d@news.astraweb.com> |
| 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.292.1427545673.10327.python-list@python.org> (permalink) |
| Lines | 41 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1427545673 news.xs4all.nl 2939 [2001:888:2000:d::a6]:44604 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:88223 |
Show key headers only | View raw
On 28/03/2015 06:26, Steven D'Aprano 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
>
c:\cpython\PCbuild>python
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> help(FAQ)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'FAQ' is not defined
>>> help('FAQ')
no Python documentation found for 'FAQ'
Less than useless, now what?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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