Hidden features of PyCharm
As the lead developer of PyCharm
, I can tell you that we don't usually hide features in random places, and there are a few reliable ways to discover most of them.
- Try Ctrl-clicking on everything (methods, functions, template tag names and parameters, etc.)
- If Ctrl-clicking works, usually so does completion (Ctrl-Space), rename (Shift-F6) and Find Usages (Alt-F7)
- Look through the menus and try out the actions that seem interesting
- Look at Settings | Inspections to configure the warnings which can be highlighted by
PyCharm
, and note that many of the inspections have quickfixes to correct the problems automatically - Read the blog and try out the features highlighted there.
Defining private module functions in python
In Python, "privacy" depends on "consenting adults'" levels of agreement - you can't force it (any more than you can in real life;-). A single leading underscore means you're not supposed to access it "from the outside" -- two leading underscores (w/o trailing underscores) carry the message even more forcefully... but, in the end, it still depends on social convention and consensus: Python's introspection is forceful enough that you can't handcuff every other programmer in the world to respect your wishes.
((Btw, though it's a closely held secret, much the same holds for C++: with most compilers, a simple #define private public
line before #include
ing your .h
file is all it takes for wily coders to make hash of your "privacy"...!-))
Hidden features of Groovy?
Using the spread-dot operator
def animals = ['ant', 'buffalo', 'canary', 'dog']
assert animals.size() == 4
assert animals*.size() == [3, 7, 6, 3]
This is a shortcut for animals.collect { it.size() }
.
Hidden Features of Erlang
The magic commands in the shell. The full list is in the manual, but the ones I use most are:
- f() - forget all variables
- f(X) - forget X
- v(42) - recall result from line 42
- v(-1) - recall result from previous line
- e(-1) - reexecute expression on previous line
- rr(foo) - read record definitions from module foo
- rr("*/*") - read record definitions from every module in every subdirectory
- rp(expression) - print full expression with record formating
Related Topics
Loop "Forgets" to Remove Some Items
How to Save/Restore a Model After Training
Combine Two Columns of Text in Pandas Dataframe
Using @Property Versus Getters and Setters
How to Write the Fibonacci Sequence
How to Concatenate Text Files in Python
Random String Generation With Upper Case Letters and Digits
How to Sort a List of Strings Numerically
Pygame Window Not Responding After a Few Seconds
Why Is _Init_() Always Called After _New_()
Split String With Multiple Delimiters in Python
Saving Utf-8 Texts With Json.Dumps as Utf8, Not as \U Escape Sequence
How to Find the Cumulative Sum of Numbers in a List
Typeerror: Method() Takes 1 Positional Argument But 2 Were Given
Permutations With Unique Values
Why Is "1000000000000000 in Range(1000000000000001)" So Fast in Python 3