some functions and classes for list( ̄︶ ̄)↗ (and some other kinds of functions)
Project description
制作者:\ BL_30G(现名为:NPC-013) <https://space.bilibili.com/1654383134>__
版权归属:\ BL_30G(现名为:NPC-013) <https://space.bilibili.com/1654383134>__
安装要求:无任何依赖库(csv_to_lst_or_dic()函数依赖pandas库)
Python版本:\ 3.7及以上
Version: 0.9.1
使用方法: import PylistFunctions(函数),import PyListFunctions.classes(类)
已有类:advanced_list, limit_len_list, type_list(已废弃)(目前3个)
已有函数:tidy_up_list(), deeply_tidy_up_list(), bubble_sort(), replace_str(), reverse_str(), statistics_str(), find_list(), list_calculation(), in_list_calculation(), var_in_list(), can_variable(), populate_lsts(), len_sorted_lst(), list_internal_situation(), csv_to_lst_or_dic(), get_type_lst(), randstr(), nrange(), remove_nesting(), uniformly_slice_list(), slice_two_dimensional_list(),location_moving()(目前22个)
更新日志:
0.1: 原始函数(暂且只有一个<(_ _)> ):tidy_up_list()
.. raw:: html
<h4>
tidy_up_list特性([STRIKEOUT:bug]):会将list内的str(float)自动转换成float
比如:str(‘3.1415926536’)会转变成float(3.1415926536)
.. raw:: html
</h4>
**0.2:** 添加函数:deeply_tidy_up_list()和bubble_sort()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. raw:: html
<h4>
更改tidy_up_list()形参为:list
.. raw:: html
</h4>
.. raw:: html
<h4>
所有函数已添加自检条件,均可放心使用~
.. raw:: html
</h4>
**0.2.1:** 修复安装不了的问题(发癫写的setup.py,总之0.1~0.2的版本都安装不了
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**0.2.2:** 修复tidy_up_list()和deeply_tidy_up_list()遇空列表,字典,集合,会报错”ValueError: list.remove(x): X Not in List”的问题
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
别问我为什么没有以上的版本,原因是之前脑瘫整出来的包不测试直接上传,后面删了工程重新发了一遍(极悲
--------------------------------------------------------------------------------------------------
**0.3:** 新增replace_str()函数,去除deeply_tidy_up_list()除lst外的任何形参,bubble_sort()增判断列表元素条件,可放心使用(真的
现在tidy_up_list()函数的特性:遇到str(int)或str(float)的类型会自动转换原本的类型 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
比如: test = str(‘114514’) (列表内的元素) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
在使用tidy_up_list()函数后会变成int(114514),(float同理) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
要是有人不需要自动转换的功能的话,我后面可能也会做额外的形参来修复的 (已经动了点,但是没时间做) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.3.1(0.3.2): 修复replace_str()形参__c长度大于__nc长度时删除原字符不干净的问题
**0.3.3:** 修复replace_str()所有问题,可放心使用(其实是我想不起来了(悲)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!0.3.3 出了新问题(del变量名语句会报错)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**0.3.4:** 修复修复replace_str()所有问题(真),bubble_sort()目前可排列str类变量(长度只能为1),且新增round形参(四舍五入)
0.3.5: 唉,冒泡排序还是回退到只能排序整数和浮点数的版本了(极悲,添加了reverse_str()函数(疑似水分
**0.4:** 更新内容:1.bubble_sort()添加形参in_reverse_order,2.添加statistics_str(),find_list(),list_calculation()共3个函数
0.4.1: 修复replace_str()删不干净字符串的问题(真真真真真)
**0.4.2:** 为迎合str.count()的计数方式,修改了replace_str判断字符的方法
例子:未修改前:print(replace_str(“helllo world”, “ll”, ““, num=2)) # 输出helo world ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
修改后:print(replace_str(“helllo world”, “ll”, ““, num=2)) # 输出helllo world ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.5.0: 更新了5个函数(按照实用程度排序),分别为:in_list_calculation(), var_in_list(), can_variable(), get_variable(), index_len()
in_list_calculation()特性:multi_calculation形参要是运算符数量不足以计算,则会填充用户所给的multi_calculation形参
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
比如:
^^^^^
test = [1, 2, [3, [4, [5], [6], 7]]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print(in_list_calculation(test, multi_calculation=“+,-”))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
则实际运算为:1+2-3+4-5+6-7
^^^^^^^^^^^^^^^^^^^^^^^^^^^
**0.6.0:** 更新类type_list,函数get_type_lst(), len_sorted_lst(), csv_to_lst_or_dic(), populate_lsts(), list_internal_situation()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**0.7.0:** type_list类已废弃,新增advanced_list类, replace_str函数新增__start和__end形参
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**0.7.0:** import错误,请勿使用
-------------------------------
**0.7.1:** 修复错误(byd这个也修错了
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**0.7.2:** 真·修复完成,(前两个版本已删除
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**0.7.3:** 真真真·修复完成,(前三个版本已删除(极悲
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**0.7.4:** 开始使用存根,修复手机qpython提示ImportError: cannot import name ‘Supportsindex’,修复advanced_list使用.pop()形参为空报错的bug
0.7.6: 修复advanced_list.copy()的报错问题,删除版本0.7.4(别问我为什么没有0.7.5),开学停更 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.7.7: 新增randstr()和nrange()函数,修复advanced_list切片得到list类问题, 修复advanced_list.replace函数形参全为None删不干净元素的问题,真·修复advanced_list.copy函数
**0.8.0:** 删除0.7.7版本(advanced_list的__getitem__犯了个大错,没有返回值,只有None),删除index_len函数,禁止advanced_list的__add__方法,新增limit_len_list类,删去advanced_list的auto_replenishment
0.9.0 类修改的地方:advanced_list添加reservation模式。advanced_list新增exchange(),modifyReservationElement(),delReservationElement(),clearReservationElement(),view_reservation_dict()方法,修改advanced_list的LockError,limit_len_list的OverMaxLengthError,replace()方法的形参。lock_all方法禁用,只允许初始化自定义值。
函数修改的地方:新增remove_nesting(),uniformly_slice_list(),slice_two_dimensional_list(),location_moving()函数,删除get_variable()函数,修改list_internal_situation()和var_in_list()函数(不使用globals()函数,安全性增加)。list_calculation()函数修改,原本的逻辑是根据给出列表长度来进行运算的,现在则是依照顺序进行运算。
文件结构大改,类和函数单独分成两个文件,如果需要使用类的话需要import PyListFunctions.classes,函数的话可以正常使用
由于__init__.py文件忘记链接classes.py,导致类不可用,所以删除0.9.0版本
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**0.9.1** 修复无法使用classes的问题
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyListFunctions-0.9.1.tar.gz.
File metadata
- Download URL: PyListFunctions-0.9.1.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c93def3ea3ca90b3c33961204ff409b3c0ed08e70608482d80727d3517b92cb1
|
|
| MD5 |
f86b7f0a41287f9eb7e66283319e72a8
|
|
| BLAKE2b-256 |
73025b77f3487d94b408d51b59b3592c6dc34202e6d27be6d49c75c2e3a857d5
|
File details
Details for the file PyListFunctions-0.9.1-py3-none-any.whl.
File metadata
- Download URL: PyListFunctions-0.9.1-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03bb95e9b0e200f48908d3821a7ad7234521bc57326265f5d851e389ce8944b4
|
|
| MD5 |
488b9474473ced7f19604a012ce99d44
|
|
| BLAKE2b-256 |
9d4b81493bc1d08d2a6f1c95850092b16f55b0f6ec3eb3963b68abfe7631459b
|