Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Extension methods for built-in type in Python.

Project description

Extension methods for built-in type in Python.

Usage

Integer

(123).instance_of(int) (123).to_s() == “123” (123).to_f() == 123.0 and (123).to_f().instance_of(float)

float

(123.45).instance_of(float) (123.45).to_s() == “123.45” (123.45).to_i() == 123

str

“hello”.instance_of(str) “hello”.length == 5 “123”.to_i() == 123 “123.45”.to_f() == 123.45 “hello”.to_s() == “hello”

Unicode

u”hello”.instance_of(unicode) u”hello”.length == 5 u”123”.to_i() == 123 u”123.45”.to_f() == 123.45 u”hello”.to_s() == u”hello”

list

[1, 2, 3, 4].instance_of(list) [1, 2, 3, 4].length == 4 [1, 2, 3, 4].sum() == 10

tuple

(1, 2, 3, 4).instance_of(tuple) (1, 2, 3, 4).length == 4 (1, 2, 3, 4).sum() == 10

Project details


Release history Release notifications

This version
History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
modernpy-0.1.0.zip (5.4 kB) Copy SHA256 hash SHA256 Source None Apr 4, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page