GraylinKim / sc2reader

A python library that extracts data from various Starcraft II resources to power tools and services for the SC2 community. Who doesn't want to hack on the games they play?
http://sc2reader.readthedocs.org
MIT License
413 stars 85 forks source link

Fix Format Strings #75

Closed GraylinKim closed 11 years ago

GraylinKim commented 12 years ago

It seems like Python2.6 doesn't let you be lazy with:

"{}, {}, {}, {}".format(a,b,c,d)

We need to fill in numbers all over the place, or use a keyword format:

"{0},{1},{2},{3}".format(a,b,c,d)
"{a},{b},{c},{d}".format(a='a',b='b',c='c',d='d')

Ugh.

dsjoerg commented 12 years ago

Is python3 really worth thinking about? How imminent or probable is the switchover?

GraylinKim commented 12 years ago

The original posting was screwed up. I think python3 supports the {}. Its Python 2.6 that is causing the issues. The {} support was added in Python 2.7.

Anyway, the issue came from @kiddle on IRC and he'll be submitting a patch for it. Hopefully he'll be sticking around to help out with some other features, documentation, and possible Python3 support as well. Huzzah, open source!

GraylinKim commented 12 years ago

Also, to address the comment on Python3; two things:

  1. Python 3 is 4 years old now! Even django is close to Python 3 support now.
  2. We can probably get away with maintaining both 2.x and 3.x on the same code base

So don't worry too much. If @kiddle winds up helping me add Python 3 support it shouldn't affect your use at all.

GraylinKim commented 12 years ago

We could also just drop 2.6 support. Dropping 2.6 support will probably be necessary when trying to bridge the Python3 gap anyway. I'm not sure if python2.6 is still a popular python version that needs to be supported though.

GraylinKim commented 11 years ago

This specific issue has been resolved and 2.6 should be supported now. I'll wait for someone actually running 2.6 to file an issue and tell me otherwise.