While everyone is saying what they want in Python :)

Don Tuttle tuttledon at hotmail.com
Tue Feb 6 16:57:20 CET 2001


"David C. Ullrich" <ullrich at math.okstate.edu> wrote in message
news:3a8012f5.7625600 at nntp.sprynet.com...
> Delphi's "with" is more or less the same < as vbscript> 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.

I'm not familar with Delphi, but I suspect this is why vbscript uses the
leading 'dot' notation.

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

Perhaps I'm missing something but using a keyword to define a single block
of code seems very explicit (ie Select Case). Again, maybe the leading 'dot'
makes all the difference.

Don

> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

> >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.







More information about the Python-list mailing list