Skip to content

Commit

Permalink
Merge pull request arrow-py#250 from beenje/static
Browse files Browse the repository at this point in the history
Cleanup class methods definition. Good clenups
  • Loading branch information
andrewelkins committed Aug 7, 2015
2 parents 8b0a560 + 8682c5b commit cdc8aa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions arrow/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ def for_json(self):

# internal tools.

@classmethod
def _get_tzinfo(cls, tz_expr):
@staticmethod
def _get_tzinfo(tz_expr):

if tz_expr is None:
return dateutil_tz.tzutc()
Expand Down Expand Up @@ -882,8 +882,8 @@ def _get_iteration_params(cls, end, limit):
else:
return end, sys.maxsize

@classmethod
def _get_timestamp_from_input(cls, timestamp):
@staticmethod
def _get_timestamp_from_input(timestamp):

try:
return float(timestamp)
Expand Down
16 changes: 8 additions & 8 deletions arrow/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ def _parse_token(self, token, value, parts):
):
parts['am_pm'] = 'pm'

@classmethod
def _build_datetime(cls, parts):
@staticmethod
def _build_datetime(parts):

timestamp = parts.get('timestamp')

Expand Down Expand Up @@ -243,24 +243,24 @@ def _parse_multiformat(self, string, formats):

return _datetime

@classmethod
def _map_lookup(cls, input_map, key):
@staticmethod
def _map_lookup(input_map, key):

try:
return input_map[key]
except KeyError:
raise ParserError('Could not match "{0}" to {1}'.format(key, input_map))

@classmethod
def _try_timestamp(cls, string):
@staticmethod
def _try_timestamp(string):

try:
return float(string)
except:
return None

@classmethod
def _choice_re(cls, choices, flags=0):
@staticmethod
def _choice_re(choices, flags=0):
return re.compile('({0})'.format('|'.join(choices)), flags=flags)


Expand Down

0 comments on commit cdc8aa7

Please sign in to comment.