[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Christopher Barker
On Tue, Apr 13, 2021 at 1:29 PM Serhiy Storchaka wrote: > 12.04.21 21:49, Christopher Barker пише: > > If I have a time I finish my large patch for getting rid of __version__ > and other outdated variables. It was approved previously > ( >

[Python-ideas] Re: Add an export keyword to better manage __all__

2021-04-13 Thread Jeff Edwards
So I think there are multiple behaviors that are being described here and I think there is validity in being able to potentially patch/modify definitions when absolutely necessary, but I wonder if there's room here for something in-between (also, I find the 'import export' or 'export import'

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Thomas Grainger
> As another data point, flit *requires* that the package has a > __version__ attribute. flit no longer requires packages support `__version__` when using PEP 621 metadata ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Serhiy Storchaka
12.04.21 21:49, Christopher Barker пише: > Over the years, I've seen __version__ used very broadly but not *quite* > in all packages. I've always known it was a convention, not a > requirement. But it turns out it's not even a "official" convention. If I have a time I finish my large patch for

[Python-ideas] Re: Iterable scalar values returning itself ones?

2021-04-13 Thread Sebastian Berg
On Tue, 2021-04-13 at 17:00 +0200, Hans Ginzel wrote: > Are there any reasons not to make scalar types iterable returning the > value ones? > Should each function check if it has got one value or a list/tuple > before iteration over the argument? > What is wrong on scalars for iteration, please? >

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Paul Moore
On Tue, 13 Apr 2021 at 18:14, Christopher Barker wrote: > > I agree here -- I think what needs to be official is what is In an installed > package/distribution -- not how it gets there. But I do think the standard > approach should be easy to do, even without special tools. That's already

[Python-ideas] Re: Iterable scalar values returning itself ones?

2021-04-13 Thread Dennis Sweeney
Whenever you extend the definition of an operation (`__iter__` in this case) to more existing objects, you lose a little bit of the ability to catch errors early. Consider the function: def traverse(something): for x in something: # do stuff ... If you

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Christopher Barker
Thanks Paul, > Having a __version__ attribute is fairly common these days, but > definitely not universal even now. So the PEP still has a place, IMO. > Indeed -- I really think it needs to be finalized one way or another. > But a lot has changed in the last 13 years. Python packaging is

[Python-ideas] Re: Revive: PEP 396 -- Module Version Numbers ?

2021-04-13 Thread Christopher Barker
On Mon, Apr 12, 2021 at 12:29 PM Thomas Grainger wrote: > I prefer to use importlib.metadata.version("dist-name") > For my part, I don't like that approach -- I really believe in KISS. That requires a pile of infrastructure to be in place -- compared to a simple attribute in a package. It just

[Python-ideas] Iterable scalar values returning itself ones?

2021-04-13 Thread Hans Ginzel
Are there any reasons not to make scalar types iterable returning the value ones? Should each function check if it has got one value or a list/tuple before iteration over the argument? What is wrong on scalars for iteration, please? There is even legal to iterate over an empty set – an empty