Giter VIP home page Giter VIP logo

sk-guritech / ext-list Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 744 KB

ExtList is a Python library that improves code quality by allowing list comprehension operations to be called as methods and handling lists more abstractly than the built-in list. It reduces list comprehensions, improving code readability and searchability.

License: MIT License

Dockerfile 1.33% Python 96.61% Shell 0.59% Makefile 0.62% Batchfile 0.79% CSS 0.06%
list-comprehension python python-library

ext-list's People

Contributors

sk-guritech avatar

Stargazers

 avatar

Watchers

 avatar

ext-list's Issues

implement 'list to sorted dict ' method

# Input
[
    {"name" : "alice", "age" : 25},
    {"name" : "bob", "age" : 30},
    {"name" : "charlie", "age" : 35},
    {"name" : "david", "age" : 30}
]


ExtList(input, key="age")  # key is FunctionType | property | str | Hashable

#Output
{
    25 : [{"name" : "alice", "age" : 25}],
    30 : [{"name" : "bob", "age" : 30}, {"name" : "david", "age" : 30}],
    35 : [{"name" : "charlie", "age" : 35}]
}

implement to_dict_list(..)

a = [{"name": "alice", "age": 20, "country": "JP"}, { "name": "bob", "age": 35, "country": "US"}]
ExtList(a).to_dict_list("name", "age")

[{"name": "alice", "age": 20}, {"name": "bob", "age": 35}]

relaxing type restrictions

現在ExtListでは単一の型のみを扱えるように制限していますが、
実用上不都合が出始めているため、制限の緩和を実装します。

methods too slow

The execution time of the method is long. It has been found to be slower by approximately up to 8 times compared to list comprehensions. The cause has been identified as the high cost of function object invocation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.