Me too. I'm a relative python-ideas newb, though, so I don't really know
the back catalog.
On Sat, Nov 30, 2019, 18:46 Christopher Barker wrote:
>
>
> On Sat, Nov 30, 2019 at 3:02 AM Brian Skinn wrote:
>
>> That aside, absolutely +1 for curating such a list. E
Ah, right -- relatively straightforward rule.
But, one that's going to require a lot of careful thought to track down exactly
how a name will resolve across an inheritance tree. Seems like a lot of extra
complexity and potential for confusion for a comparatively small benefit.
Also, I have to t
What happens when aliases collide with proper attributes? Could you have an
attribute 'foo', combined with an attribute 'bar' with alias 'foo'? If so, how
would that work?
What happens when a subclass of Foo adds an attribute that masks an alias
defined for an attribute of Foo?
Dragons. Compli
Steve,
It looks like what you're trying to achieve is an Enum with more than a
singleton `.value` exposed on each sub-item.
I was able to achieve something that *looks* like your example using an Enum
mixin with a custom class:
> from enum import Enum
class Labeler:
@property
def la
That aside, absolutely +1 for curating such a list. Excellent idea.
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Mes
Why, we could even number them, call them Python-Issues Common Threads,
abbreviate that as "PICT", and then refer to them as, e.g., "PICT-114"!! :-D
:-D :-D :-D ... |-[
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an ema
@jayvdb on GitHub and I are working on a new version of one of my packages,
stdio-mgr (https://github.com/bskinn/stdio-mgr), with a dramatically expanded
API and capabilities.
Context managers feature heavily in the planned design; part of the design plan
is to allow instantiation of a StdioMan
Andrew Barnert wrote:
> What does it do for zipimported modules, bootstrapped modules, modules
> distributed as a .pyc file without the .py source, etc., plain old .py filed
> but that are
> found in an unusual way (a 3.x equivalent of Appleās 2.7 Extras directory, or
> even a
> custom importlib
Jonathan Fine wrote:
> Suppose we had a similar 'which' command in Python. It wouldn't by
> itself stop things going wrong. But when they do go wrong, it might
> help diagnose the problem.
This thread got me thinking about something exactly along these lines.
It looks like the needed information
I feel like the semantics of PurePath.suffix
(https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.suffix) and
PurePath.stem define this pretty unambiguously.
I.e., it should be:
p = Path("foo.bar.txt")
p.with_stem("quux")
"quux.txt"
p.with_stem("baz.quux")
"baz.quux.txt"
___
Steven D'Aprano wrote:
> We're talking about an operator to copy-and-update a dict, not invade
> Iraq.
[grin] Fair enough.
In the interim, actually, I realized some semantic downsides of using pipe.
If a user happens to draw an analogy to logical 'or', the 'which one wins'
semantics is differ
Christopher Barker wrote:
> if | is implemented, I'll bet you dollars to donuts that it will get used
> far less than if + were used.
> (though some on this thread would think that's a good thing :-) )
> -CHB
(Non-beginner, |-preferrer)
I think Christopher is correct here, but only to a point. I
Agreed -- Anyone who uses numpy a lot might make the same assumption, because
numpy vectorizes. Anybody who doesn't might expect an extension-equivalent:
>>> import numpy as np
>>> a1 = np.arange(2,6)
>>> a2 = np.arange(4,0,-1)
>>> a2
array([4, 3, 2, 1])
>>> a1
array([2, 3, 4, 5])
>>> a1 + a2
arr
**Strongly** disagree. I would anticipate using this feature a LOT, and would
be excited to see it added. (I would love to replace things like "d2 =
d1.copy(); d2.update(d3)" with just "d2 = d1 | d3". In-place "d2 |= d3" is nice
in its terseness, but isn't a huge benefit.) But, I completely agr
Okie, looks like my code got munched in the web view -- how do I make it
not do that?
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python
I thought of something similar, but where the dict-literal construction is
desired:
>>> foo = True
>>> bar = False
>>> baz = False
>>> d = {
... 'foo' if foo else None: 1,
... 'bar' if bar else None: 2,
... 'baz' if baz else None: 3,
... }
>>> d
{'foo': 1, None: 3}
>>> d.pop(None)
3
>>> d
{
On Tue, Aug 20, 2019 at 6:14 AM Matthew Brett
wrote:
> Hi,
>
> On Tue, Aug 20, 2019 at 11:10 AM Brian Skinn
> wrote:
> >
> >
> >
> > On Tue, Aug 20, 2019, 06:05 Matthew Brett
> wrote:
> >>
> >> Hi,
> >
> >
> >> Se
17 matches
Mail list logo