While everyone is saying what they want in Python :)

David C. Ullrich ullrich at math.okstate.edu
Tue Feb 6 22:51:19 CET 2001


In article <A9Vf6.38067$p8.8472953 at typhoon.southeast.rr.com>,
  "Don Tuttle" <tuttledon at hotmail.com> wrote:
> "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.

No doubt.

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

I didn't mean to get into off-topic heresy, but I don't know what
you mean by calling this "explicit". The problem is that the methods
could be methods of AnObject or they could have nothing to do with
AnObject. As opposed to an explicit AnObject,OneThing.

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

--
Oh, dejanews lets you add a sig - that's useful...


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list