Linked Questions
86 questions linked to/from Hidden features of Python
0
votes
2
answers
434
views
Check if number is between given range [duplicate]
I came across an answer that we can check if number is between a given range by following method 10<=n<=100. I want to know how exactly this statement gets executed in python.I'm new to python ...
2
votes
1
answer
565
views
Strange chained comparison [duplicate]
>>> a = 2
>>> b = 3
>>> c = 2
>>> b > a == c
True
>>>
Is this true that b > a == c is equal to a < b and c == a because it's a chained comparison?
...
2
votes
0
answers
138
views
What is different between 11<8 == 34>67 and (11<8) == (34>67)? [duplicate]
>>> 11<8 == 34>67
False
>>> (11<8) == (34>67)
True
Why are the results different? What's going on here?
13107
votes
50
answers
3.5m
views
What does the "yield" keyword do in Python?
What functionality does the yield keyword in Python provide?
For example, I'm trying to understand this code1:
def _get_child_candidates(self, distance, min_dist, max_dist):
if self._leftchild and ...
7512
votes
26
answers
1.2m
views
What are metaclasses in Python?
What are metaclasses? What are they used for?
2628
votes
27
answers
1.8m
views
Class (static) variables and methods
How do I create class (i.e. static) variables or methods in Python?
312
votes
99
answers
157k
views
Hidden Features of JavaScript? [closed]
What "Hidden Features" of JavaScript do you think every programmer should know?
After having seen the excellent quality of the answers to the following questions I thought it was time to ask it for ...
403
votes
29
answers
192k
views
Showing the stack trace from a running Python application
I have this Python application that gets stuck from time to time and I can't find out where.
Is there any way to signal Python interpreter to show you the exact code that's running?
Some kind of on-...
141
votes
78
answers
63k
views
Hidden features of Perl?
What are some really useful but esoteric language features in Perl that you've actually been able to employ to do useful work?
Guidelines:
Try to limit answers to the Perl core and not CPAN
Please ...
109
votes
36
answers
42k
views
Hidden features of HTML
HTML being the most widely used language (at least as a markup language) has not gotten its due credit.
Considering that it has been around for so many years, things like the FORM / INPUT controls ...
159
votes
46
answers
44k
views
Hidden features of Ruby
Continuing the "Hidden features of ..." meme, let's share the lesser-known but useful features of Ruby programming language.
Try to limit this discussion with core Ruby, without any Ruby on Rails ...
415
votes
11
answers
408k
views
Double Iteration in List Comprehension [duplicate]
In Python you can have multiple iterators in a list comprehension, like
[(x,y) for x in a for y in b]
for some suitable sequences a and b. I'm aware of the nested loop semantics of Python's list ...
123
votes
25
answers
35k
views
Hidden features of WPF and XAML?
Here is a large number of hidden features discussed for variety of languages. Now I am curious about some hidden features of XAML and WPF?
One I have found is the header click event of a ListView
&...
148
votes
22
answers
328k
views
How to obfuscate Python code effectively? [duplicate]
I am looking for how to hide my Python source code.
print "Hello World!"
How can I encode this example so that it isn't human-readable? I've been told to use base64 but I'm not sure how.
72
votes
43
answers
43k
views
Hidden features of Bash
Shell scripts are often used as glue, for automation and simple one-off tasks. What are some of your favorite "hidden" features of the Bash shell/scripting language?
One feature per answer
Give an ...