dsc / bunch

A Bunch is a Python dictionary that provides attribute-style access (a la JavaScript objects).
http://github.com/dsc/bunch
MIT License
482 stars 177 forks source link

Fix python version check #7

Closed abadger closed 1 month ago

abadger commented 11 years ago

The recent merge for python3 compatibility contained some code that wasn't correct. Checking for the version of python that code is being run on should compare against sys.version_info. The current code compares against platform.version which is something else entirely.

A side note to the fix -- Function calls are expensive in python. If the places that python3_compat.u() are used turn out to be performance critical there might be noticable slowdowns. python-3.3 re-adds the u"I am string" syntax so one idea could be to punt this issue and say that if run on python3, bunch needs python-3.3 or greater.

abadger commented 11 years ago

Hey, are you still maintaining python-bunch? I'm happy to help out if you need it.