While everyone is saying what they want in Python :)

jurgen.defurne at philips.com jurgen.defurne at philips.com
Wed Feb 7 02:17:03 EST 2001


In fact, 'with' is not an artefact of Delphi, but from the plain, original Pascal!

Jurgen




ullrich at math.okstate.edu@SMTP at python.org on 06/02/2001 16:42:59
Please respond to ullrich at math.okstate.edu@SMTP 
Sent by:	python-list-admin at python.org
To:	python-list at python.org@SMTP
cc:	 
Subject:	Re: While everyone is saying what they want in Python :)
Classification:	

On Tue, 06 Feb 2001 01:35:02 GMT, "Don Tuttle" <tuttledon at hotmail.com>
wrote:

>
>"Jay O'Connor" <joconnor at cybermesa.com> wrote in message
>news:3A7DB154.87E04245 at cybermesa.com...
>> I'm not familiar with the 'with' keyword in Delphi.
>
>Here's a vbscript example.
>With MyLabel
>   .Height = 2000
>   .Width = 2000
>   .Caption = "This is MyLabel"
>End With
>Personally, I'd love to see Python include the 'with' keyword! It improves
>readability and should execute a bit faster as well.

Delphi's "with" is more or less the same except without the
dots at the start of the field names. For a long time I've
seen Delphi people say that with is bad, the reason
being it leads to bugs

with AnObject do
  begin
    OneThing
    AnotherThing
  end

when AnObject does not have a OneThing method
but there _is_ a OneThing in the surrounding scope.

For years I thought this was just stupid - you should
know what sort of object you're dealing with. The
Python slogans about how explicit is better than
implicit just about have me convinced that
people are right, with is bad.

Right or not, it certainly seems contrary to the
"explciit is better than implicit" philosophy.

>Don
>
>
>
>

--
http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list