Questions tagged [user-defined]
253 questions
174
votes
17 answers
Set Locale programmatically
My app supports 3 (soon 4) languages. Since several locales are quite similar I'd like to give the user the option to change locale in my application, for instance an Italian person might prefer Spanish over English.
Is there a way for the user to…

Roland
- 5,328
- 10
- 37
- 55
151
votes
3 answers
How is __eq__ handled in Python and in what order?
Since Python does not provide left/right versions of its comparison operators, how does it decide which function to call?
class A(object):
def __eq__(self, other):
print "A __eq__ called"
return self.value == other
class…

PyProg
- 1,525
- 2
- 10
- 4
65
votes
11 answers
Calling a user defined function in jQuery
I am trying to call a user defined function in jQuery:
$(document).ready(function() {
$('#btnSun').click(function() {
myFunction();
});
$.fn.myFunction = function() {
alert('hi');
}
});