문제

Anyone knows why Pylons allowing duplicate action in same controller instead of throwing error? And the controller ignores first duplicate action and always serves the second duplicate?

도움이 되었습니까?

해결책

being python the second function definition overrides the first.

drop this code in a file called test.py

# test.py
def my_func():
    print "i will never get called"

def my_func():
    print "awesome"

my_func()

and run it

$ python test.py
awesome

no errors, same applies for methods on objects.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top