[Python-ideas] `join` method for the `list` class ... `list.join`

2023-06-06 Thread Samuel Muldoon
To Whom it May Concern, Python's `str` class has a method named `join` I was wondering if a future release of python could have a `list.join` which behaves in a similar fashion. *result = [99].join([1, 2, 3])print(result)# prints [1, 99, 2, 99, 3]* *Samuel Muldoon* *(720) 653

[Python-ideas] extend method of the list class could return a reference to the list so that we can chain method calls

2023-05-28 Thread Samuel Muldoon
*Currently, list.extend does not allow method chaining.* *parameters = ["zero or more","zero or more".upper(),"zero or more".lower(),"Zero or More"* *].extend(["(0, +inf)", "[0; +in**f]"])* *parameters.extend([&quo

[Python-ideas] Allowing `str.format` to format one or more parameters instead of all parameters

2023-04-21 Thread Samuel Muldoon
ines of code in python, probably less than fifty lines in C, or a different implementation language. class str: def format(self, **kwargs): for key in kwargs: x = "{"+key+"}" ostr = kwargs[key].join(self.split(x)) return ostr # output

[Python-ideas] Can we give built-in `help` function a `__qualname__` attribute

2023-04-07 Thread Samuel Muldoon
Hi, A lot of python's built-in functions have an attribute named __qualname__. However, the built-in `help` function has no __qualname__ attribute. In a future version of python can we have: help.__qualname__ = "help" ___ Python-ideas mailing list --

[Python-ideas] An interface for `mro` methods similar to the interface for `iter`, `getattr`, etc...

2023-03-24 Thread Samuel Muldoon
amed `object` should have a method named `__mro__` and any class which inherits from `object` may override `__mro__` or inherit the default `* *object* *.__mro__` . * *Samuel Muldoon* *(720) 653 -2408* *muldoonsam...@gmail.com * ___ Python-ideas ma

[Python-ideas] Using "Get Satisfaction" for Python Suggestions

2022-02-18 Thread Samuel Muldoon
way to vet changes to the Python interpreter or other aspects of the python language. If the power-that-be would work with GetSatisfaction people to make a copy-cat of the GetSatisfaction page for Minecraft, I think that the python community could then better drive PEPs (Python Enhancement Pro

[Python-ideas] Improved Function Decorators

2019-11-18 Thread Samuel Muldoon
At present, multi-argument function decorators are a little bit tricky to implement. As an example (somewhat contrived), suppose that `wait` is a function decorator which haults program execution for a few seconds before calling the wrapped function. If you do not pass a float value into *delay*

[Python-ideas] `__lcontains__` for letting the other class determine container membership when `__contains__` fails

2019-11-12 Thread Samuel Muldoon
*Currently, the `in` operator (also known as `__contains__`) always uses the rightmost argument's implementation.* *For example,* > * status = obj in "xylophone" * > *Is similar to:* *status = "xylophone".__contains__( obj )* *The current implementation of `__contains__` is similar t