Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

2to3 python conversion with major version bump to 1.0.0-yr.alpha #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ogrubes
Copy link

@ogrubes ogrubes commented Nov 3, 2016

ran 2to3 python conversion tool.
wholly untested.

Copy link

@chuckg chuckg left a comment

Choose a reason for hiding this comment

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

Looks good, minus the questions around callable on non-lists.

@@ -86,7 +87,7 @@ def method_fields(self, handler, fields):
for field in fields - Emitter.RESERVED_FIELDS:
t = getattr(handler, str(field), None)

if t and callable(t):
if t and isinstance(t, collections.Callable):
Copy link

Choose a reason for hiding this comment

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

The original code should still work here in 3.5; they re-added callable in 3.2

@@ -30,8 +31,8 @@ class Resource(object):
'PUT': 'update', 'DELETE': 'delete' }

def __init__(self, handler, authentication=None):
if not callable(handler):
raise AttributeError, "Handler not callable."
if not isinstance(handler, collections.Callable):
Copy link

Choose a reason for hiding this comment

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

Don't think this works; this isn't a collection.

@@ -86,10 +87,10 @@ def anonymous(self):
if hasattr(self.handler, 'anonymous'):
anon = self.handler.anonymous

if callable(anon):
if isinstance(anon, collections.Callable):
Copy link

Choose a reason for hiding this comment

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

Non-list?

@@ -140,16 +140,16 @@ def test():
>>> is_valid_javascript_identifier('$210')
True

>>> is_valid_javascript_identifier(u'Stra\u00dfe')
>>> is_valid_javascript_identifier(u'Stra\\u00dfe')
Copy link

Choose a reason for hiding this comment

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

Didn't update the comments correctly here, re: u'string' unicode string classifier.

@@ -221,7 +222,7 @@ def _model(data, fields=()):
if inst:
if hasattr(inst, 'all'):
ret[model] = _related(inst, fields)
elif callable(inst):
elif isinstance(inst, collections.Callable):
Copy link

Choose a reason for hiding this comment

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

Not collection?

@@ -236,7 +237,7 @@ def _model(data, fields=()):
else:
maybe = getattr(data, maybe_field, None)
if maybe is not None:
if callable(maybe):
if isinstance(maybe, collections.Callable):
Copy link

Choose a reason for hiding this comment

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

Not collection?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants