10 sec poll - please reply!
ramit.prasad at jpmorgan.com
Tue Nov 20 22:08:24 CET 2012
Steven D'Aprano wrote:
> On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote:
> > Thanks again for your further replies. So far, it's 4 votes for
> > 'send_keys' and 1 vote for 'type'.
> > Regarding 'send_keys': To me personally it makes sense to send keys _to_
> > something. However, in our API, send_keys would not be called on an
> > object or with a parameter indicating the target. It would just be
> > send_keys(ENTER)
> > send_keys("Hello World!")
> > send_keys(CTRL + 'a')
> "send_keys" is wrong, because you aren't sending keys. You're sending
> strings, except you aren't actually sending strings either, because
> "send" does not make sense without a target. You're automating the typing
> of strings, including control characters.
> I believe that your initial instinct for the name of this function was
> correct. It automates typing, so you should call it "type" or (for those
> paranoid about shadowing the built-in, "type_str".
I can too easily see somebody doing from module import *
OR from module import type.
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
More information about the Python-list