As telling in the subject,because "list" and "tuple" aren't functions,they are
types.Is that right?
--
http://mail.python.org/mailman/listinfo/python-list
Hey guy,thx for you feedback first.
But I can't follow your opinion.Why?because of the list & tuple are placed at
built-in function,so before I type 'list' unintentionally on the pyshell and it
show me "", I never know that the name 'list' is a type,I used to
consider it's a function to produce
Why I use assertion,please check this code:
"""
class User(object):pass
class Student(User):pass
class Professional(User):pass
def add(user):
assert(user, User)
def add(users):
assert(users, (tuple, list))
#If necessary I'll also check every obj in the sequence to see whether it's
> Perhaps you meant this?
>
> assert isinstance(user, User)
Yes I meant this,sorry,my mistake.
Thx for your and Ben's feedbacks first,it's appreciated.
your points is taken by me,but I want to make my opinion more clearly.
The assertion is JUST show to my function call
Supplement:
The assertion will not be handled anyway.
I want AssertionError raise as early as possible.(mentinoed before)
--
http://mail.python.org/mailman/listinfo/python-list
How to "statically type" an instance of class that I pass to a method of other
instance?
I suppose there shall be some kind of method decorator to treat an argument as
an instance of class?
Generally it is needed so IDE (PyCharm) can auto-complete instance's methods
and properties.
Pseudo-pyt
press_keys()
On Tuesday, November 20, 2012 2:18:38 PM UTC+2, Michael Herrmann wrote:
> Hi,
>
>
>
> I'm developing a GUI Automation library (http://www.getautoma.com) and am
> having difficulty picking a name for the function that simulates key strokes.
> I currently have it as 'type' but tha