Skip to content

STORM-2339: Python code format cleanup in storm.py - #1918

Closed
tibkiss wants to merge 1 commit into
apache:1.0.x-branchfrom
tibkiss:fix/beauty_contest
Closed

STORM-2339: Python code format cleanup in storm.py#1918
tibkiss wants to merge 1 commit into
apache:1.0.x-branchfrom
tibkiss:fix/beauty_contest

Conversation

@tibkiss

Copy link
Copy Markdown
Contributor

No description provided.

@tibkiss

Copy link
Copy Markdown
ContributorAuthor

This PR has been pending since a while now.
Could someone please take a look?

Thanks!

@harshach

Copy link
Copy Markdown
Contributor

+1 on code. @tibkiss please change the title of the JIRA and commit text to something meaningful like "Python code format cleanup in storm.py".

@tibkisstibkiss changed the title STORM-2339: Beauty contest in storm.pySTORM-2339: Python code format cleanup in storm.pyFeb 25, 2017
@tibkiss

Copy link
Copy Markdown
ContributorAuthor

Thanks for the review @harshach , I've changed the title in JIRA, PR & commit message accordingly.

@tibkiss

Copy link
Copy Markdown
ContributorAuthor

bump

@HeartSaVioRHeartSaVioR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. +1

Comment threadbin/storm.py
storm_log_dir = confvalue("storm.log.dir",[CLUSTER_CONF_DIR])
if(storm_log_dir == None or storm_log_dir == "nil"):

def exec_storm_class(klass, jvmtype="-server", jvmopts=None, extrajars=None, args=None, fork=False, daemon=True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: I know it works, but would like to see why you avoid having [] as default value.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you asked. Specifying empty list as default gets initialized once, therefore multiple calls to the function will accumulate the appended values to the list. More lengthy description of this 'feature' could be found here: http://effbot.org/zone/default-values.htm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow... I didn't know its behavior completely even I worked with Python for 2 years! (4 years ago indeed...) Feels like far from its definition... Thanks for sharing.

@tibkiss

Copy link
Copy Markdown
ContributorAuthor

"At 2 months, your baby doesn’t yet have the coordination to play with toys. But she may bat at a colorful object hanging in front of her. Your baby may even briefly hold a toy that you place in one of her hands."

Could someone please merge this before it starts to play with toys? Thanks.

@HeartSaVioR

Copy link
Copy Markdown
Contributor

@tibkiss Sorry forgot this completely. I'll merge this.

@HeartSaVioR

Copy link
Copy Markdown
Contributor

@tibkiss
But not against 1.0.x branch since I don't mind that version line any more. I'll merge this to master and 1.x branch. Please let me know if you really would like to merge this to 1.0.x branch.

@HeartSaVioR

Copy link
Copy Markdown
Contributor

@tibkiss
Unfortunately too much changes have been applied to both master and 1.x branch, hence lots of merge conflicts occur.
I'm really sorry but could you work on this for master and 1.x-branch?

And please let me know if you adopt based on some guides like PEP8. We've introduced style guide for Java, and maybe we could introduce one for Python.

@tibkiss

Copy link
Copy Markdown
ContributorAuthor

This is unfortunate.
Maybe someone else can take this on: My eagerness evaporated somewhere around April.

@HeartSaVioR

Copy link
Copy Markdown
Contributor

@tibkiss I understand. Let's close this for now. Maybe along with a consistent style guide would be also better for python code, though we only use python for startup script.

d2r pushed a commit to d2r/storm that referenced this pull request Oct 16, 2018
We are closing stale Pull Requests to make the list more manageable.
Please re-open any Pull Request that has been closed in error.
Closesapache#608Closesapache#639Closesapache#640Closesapache#648Closesapache#662Closesapache#668Closesapache#692Closesapache#705Closesapache#724Closesapache#728Closesapache#730Closesapache#753Closesapache#803Closesapache#854Closesapache#922Closesapache#986Closesapache#992Closesapache#1019Closesapache#1040Closesapache#1041Closesapache#1043Closesapache#1046Closesapache#1051Closesapache#1078Closesapache#1146Closesapache#1164Closesapache#1165Closesapache#1178Closesapache#1213Closesapache#1225Closesapache#1258Closesapache#1259Closesapache#1268Closesapache#1272Closesapache#1277Closesapache#1278Closesapache#1288Closesapache#1296Closesapache#1328Closesapache#1342Closesapache#1353Closesapache#1370Closesapache#1376Closesapache#1391Closesapache#1395Closesapache#1399Closesapache#1406Closesapache#1410Closesapache#1422Closesapache#1427Closesapache#1443Closesapache#1462Closesapache#1468Closesapache#1483Closesapache#1506Closesapache#1509Closesapache#1515Closesapache#1520Closesapache#1521Closesapache#1525Closesapache#1527Closesapache#1544Closesapache#1550Closesapache#1566Closesapache#1569Closesapache#1570Closesapache#1575Closesapache#1580Closesapache#1584Closesapache#1591Closesapache#1600Closesapache#1611Closesapache#1613Closesapache#1639Closesapache#1703Closesapache#1711Closesapache#1719Closesapache#1737Closesapache#1760Closesapache#1767Closesapache#1768Closesapache#1785Closesapache#1799Closesapache#1822Closesapache#1824Closesapache#1844Closesapache#1874Closesapache#1918Closesapache#1928Closesapache#1937Closesapache#1942Closesapache#1951Closesapache#1957Closesapache#1963Closesapache#1964Closesapache#1965Closesapache#1967Closesapache#1968Closesapache#1971Closesapache#1985Closesapache#1986Closesapache#1998Closesapache#2031Closesapache#2032Closesapache#2071Closesapache#2076Closesapache#2108Closesapache#2119Closesapache#2128Closesapache#2142Closesapache#2174Closesapache#2206Closesapache#2297Closesapache#2322Closesapache#2332Closesapache#2341Closesapache#2377Closesapache#2414Closesapache#2469
d2r pushed a commit to d2r/storm that referenced this pull request Oct 16, 2018
We are closing stale Pull Requests to make the list more manageable.
Please re-open any Pull Request that has been closed in error.
Closesapache#608Closesapache#639Closesapache#640Closesapache#648Closesapache#662Closesapache#668Closesapache#692Closesapache#705Closesapache#724Closesapache#728Closesapache#730Closesapache#753Closesapache#803Closesapache#854Closesapache#922Closesapache#986Closesapache#992Closesapache#1019Closesapache#1040Closesapache#1041Closesapache#1043Closesapache#1046Closesapache#1051Closesapache#1078Closesapache#1146Closesapache#1164Closesapache#1165Closesapache#1178Closesapache#1213Closesapache#1225Closesapache#1258Closesapache#1259Closesapache#1268Closesapache#1272Closesapache#1277Closesapache#1278Closesapache#1288Closesapache#1296Closesapache#1328Closesapache#1342Closesapache#1353Closesapache#1370Closesapache#1376Closesapache#1391Closesapache#1395Closesapache#1399Closesapache#1406Closesapache#1410Closesapache#1422Closesapache#1427Closesapache#1443Closesapache#1462Closesapache#1468Closesapache#1483Closesapache#1506Closesapache#1509Closesapache#1515Closesapache#1520Closesapache#1521Closesapache#1525Closesapache#1527Closesapache#1544Closesapache#1550Closesapache#1566Closesapache#1569Closesapache#1570Closesapache#1575Closesapache#1580Closesapache#1584Closesapache#1591Closesapache#1600Closesapache#1611Closesapache#1613Closesapache#1639Closesapache#1703Closesapache#1711Closesapache#1719Closesapache#1737Closesapache#1760Closesapache#1767Closesapache#1768Closesapache#1785Closesapache#1799Closesapache#1822Closesapache#1824Closesapache#1844Closesapache#1874Closesapache#1918Closesapache#1928Closesapache#1937Closesapache#1942Closesapache#1951Closesapache#1957Closesapache#1963Closesapache#1964Closesapache#1965Closesapache#1967Closesapache#1968Closesapache#1971Closesapache#1985Closesapache#1986Closesapache#1998Closesapache#2031Closesapache#2032Closesapache#2071Closesapache#2076Closesapache#2108Closesapache#2119Closesapache#2128Closesapache#2142Closesapache#2174Closesapache#2206Closesapache#2297Closesapache#2322Closesapache#2332Closesapache#2341Closesapache#2377Closesapache#2414Closesapache#2469
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@tibkiss@harshach@HeartSaVioR