Skip to main content

use prototype and its gramma in python

Project description

一种新的表达和语法,综合了Python的简洁和JavaScript的灵活,同时保留了Python的静态类型和JavaScript的动态类型。

可以使用

pip install jsproto

安装。 使用方法:

from jsproto import *

(var(['apple', 'banana', 'pear'])
 .forEach(function(lambda s: 'long' if len(s) > 5 else 'short')
          .then(print)))

(var({
    "name": "John",
    "age": 30,
    "contact": {
        "email": "john@example.com",
        "phone": "1234567890"
    },
    "hobbies": var(["reading", "swimming", "traveling"])
    .map(lambda s:s.upper())(),
    "is_student": False
}).contact.email
 .then(print))

# 输出
# short
# long
# short
# john@example.com

Project details


Download files

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

Source Distribution

jsproto-0.6.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsproto-0.6-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file jsproto-0.6.tar.gz.

File metadata

  • Download URL: jsproto-0.6.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for jsproto-0.6.tar.gz
Algorithm Hash digest
SHA256 316f55ad3c86bbb3dcb7bda6da57671e245a17e34de18d9906681da6010ed564
MD5 1fddcaee0e93b53f6b81ad761e778d2d
BLAKE2b-256 ceae82b3c9acb92066ad293b55d056270f891a52e1744fafab1a0e054e37acda

See more details on using hashes here.

File details

Details for the file jsproto-0.6-py3-none-any.whl.

File metadata

  • Download URL: jsproto-0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for jsproto-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6093eec8073e09c70438d515f246b4b9a6eae7edee848c5aab6339c1ce0edfdd
MD5 6678f986cb9d82263eb30eef76cf52ca
BLAKE2b-256 49b44b5793f86b7a4f4735e712230a3416a0e6f9cb3e01728b14fc2bf6002ed8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page