X Tutup
Skip to content

Move the IEnumerable converter in Converter.ToPython to the TypeCode.Object case.#3

Closed
patstew wants to merge 1 commit intofkarb:python3from
patstew:python3
Closed

Move the IEnumerable converter in Converter.ToPython to the TypeCode.Object case.#3
patstew wants to merge 1 commit intofkarb:python3from
patstew:python3

Conversation

@patstew
Copy link
Copy Markdown

@patstew patstew commented Feb 20, 2015

I think this is the right place for it, it certainly fixes the test code I left in Readme.md (which is currently broken).

@tonyroberts
Copy link
Copy Markdown
Member

Hi,

hmm not so sure about this... what if you had an object that was IEnumerable but you didn't want it to be converted eagerly to a list? E.g. a database result set? Wouldn't it be better to return a Python wrapper that implements iter?

cheers,
Tony

@patstew
Copy link
Copy Markdown
Author

patstew commented Feb 24, 2015

Fair enough. I put this back because someone emailed me about the Readme example I wrote a while ago not working anymore. It's useful for what I'm doing but I suppose it might be quite annoying for others. I think you're right, it'd be better to implement the sequence interface on ILists, iter on IEnumerables and the mapping interface on IDictionaries. I'll look at doing that at some point.

@patstew patstew closed this Feb 24, 2015
Sign up for free to 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.

2 participants

X Tutup