Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Lazy_Kent
pypar2
pypar2-1.4-typeorder.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pypar2-1.4-typeorder.patch of Package pypar2
Description: Use a list of tuples instead of depending on dict iteration order Author: Stefano Rivera <stefanor@debian.org> Bug-Debian: http://bugs.debian.org/617966 Bug-Ubuntu: https://bugs.launchpad.net/bugs/719708 Forwarded: yes Last-Update: 2011-03-23 --- a/src/typeToolBox.py +++ b/src/typeToolBox.py @@ -20,14 +20,14 @@ # Supported types # 'bool' type must be placed *before* 'int' type, otherwise booleans are detected as integers -types = {bool : 'bool', int : 'int', str : 'str'} +types = [(bool, 'bool'), (int, 'int'), (str, 'str')] # Return a String with the type of value def getType(value) : - for type in types.keys() : + for type, name in types: if isinstance(value, type) : - return types[type] + return name raise TypeError, str(value) + _(' has an unsupported type')
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor