Murali Mopuru
Murali Mopuru

Reputation: 6570

Why Pylons allowing duplicate action in same controller

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?

Upvotes: 2

Views: 42

Answers (1)

Tom Willis
Tom Willis

Reputation: 5303

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.

Upvotes: 1

Related Questions