是否有独立的 Python 类型转换库? [英] Is there a standalone Python type conversion library?

查看:29
本文介绍了是否有独立的 Python 类型转换库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何独立的类型转换库?

Are there any standalone type conversion libraries?

我有一个只能识别字节/字符串的数据存储系统,但我可以标记元数据,例如要转换为的类型.

I have a data storage system that only understands bytes/strings, but I can tag metadata such as the type to be converted to.

我可以编写一些简单的类型转换器系统,就像我之前的所有其他应用程序所做的那样,或者我可以使用一个独立的库,除非我找不到.这种常见的活动很奇怪.

I could hack up some naive system of type converters, as every other application has done before me, or I could hopefully use a standalone library, except I can't find one. Odd for such a common activity.

只是为了澄清,我将有类似的东西:

Just to clarify, I will have something like:

('123', 'integer') 我想得到 123

('123', 'integer') and I want to get out 123

推荐答案

Flatland 在这方面做得很好.http://discorporate.us/projects/flatland/

Flatland does this well. http://discorporate.us/projects/flatland/

这篇关于是否有独立的 Python 类型转换库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆