1
的名稱中刪除下劃線我有兩個功能,用長名稱:我可以從一個Python測試功能
# ruby
def test_write_method_raises_value_error
# python
def test_write_method_raises_value_error(self):
在紅寶石我可以rename
的功能如下:
test 'write method should raise value error' do
# rest of function
有在Python中可比較的構造?
不,那會不會是在Python函數名的合法性。 – davidism 2014-10-27 13:03:25
你可以做的是將方法保存在一個變量中。 – 2014-10-27 13:04:40
你可以刪除它,但pep8說它不是Python風格。請檢查這個http://legacy.python.org/dev/peps/pep-0008/#function-names。 Python不會給出錯誤,但不是它的味道。 – Nilesh 2014-10-27 13:06:58