Re: the name ``wheel''

2024-03-21 Thread Thomas Passin via Python-list

On 3/21/2024 4:19 PM, Grant Edwards via Python-list wrote:

On 2024-03-21, MRAB via Python-list  wrote:


As it's recommended to use the Python Launcher py on Windows, I use
that instead:

py -m pip install something

because it gives better support if you have multiple versions of
Python installed.


I adopted that practice years ago on Linux as well after wasting what
seemed like most of a day trying to figure out problems which turned
out to be caused by the fact that "pip" and "python" invoked different
versions of Python.


Although you still need to be aware that there might be a different 
Python installation between e.g. "python3 -m pip" and "python3.11 -m 
pip", etc. depending on what's been installed.


--
https://mail.python.org/mailman/listinfo/python-list


Re: the name ``wheel''

2024-03-21 Thread Grant Edwards via Python-list
On 2024-03-21, MRAB via Python-list  wrote:

> As it's recommended to use the Python Launcher py on Windows, I use
> that instead:
>
> py -m pip install something
>
> because it gives better support if you have multiple versions of
> Python installed.

I adopted that practice years ago on Linux as well after wasting what
seemed like most of a day trying to figure out problems which turned
out to be caused by the fact that "pip" and "python" invoked different
versions of Python.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the name ``wheel''

2024-03-21 Thread MRAB via Python-list

On 2024-03-21 11:36, Johanne Fairchild via Python-list wrote:

Why is a whl-package called a ``wheel''?  Is it just a pronunciation for
the extension WHL or is it really a name?

Also, it seems that when I install Python on Windows, it doesn't come
with pip ready to run.  I had to say

   python -m ensurepip

and then I saw that a pip on a whl-package was installed.  Why doesn't
the official distribution make pip ready to run by default?  Thank you!


When I install Python on Windows, I always get pip by default, although 
it might not be on the system search path.


As it's recommended to use the Python Launcher py on Windows, I use that 
instead:


py -m pip install something

because it gives better support if you have multiple versions of Python 
installed.

--
https://mail.python.org/mailman/listinfo/python-list


Re: the name ``wheel''

2024-03-21 Thread Johanne Fairchild via Python-list
r...@zedat.fu-berlin.de (Stefan Ram) writes:

> Johanne Fairchild  wrote or quoted:
>>Why is a whl-package called a ``wheel''?  Is it just a pronunciation for
>>the extension WHL or is it really a name?
>
>   PyPi in its initial state was named "cheese shop", as the famous
>   part in the show "Monty Python Cheese Shop". Because initially it
>   only hosted links to the packages, so it was empty like that shop.
>   And within a cheese shop what do you store? Wheels of cheese.

Lol!  Loved it.  (Thanks very much.)

>>Also, it seems that when I install Python on Windows, it doesn't come
>>with pip ready to run.  I had to say
>
>   Some Python distributions do not come with pip pre-installed
>   because they have their own package management systems.

But this was a Windows install.  I don't think Windows has its own
package management for Python packages.  I'd be totally surprised.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the name ``wheel''

2024-03-21 Thread Left Right via Python-list
I believe that the name "Wheel" was a reference to "reinventing the
wheel". But I cannot find a quote to support this claim. I think the
general sentiment was that it was the second attempt by the Python
community to come up with a packaging format (first being Egg), and so
they were reinventing the wheel, in a way.

I cannot speak to the other question though: I don't know. This is
however also a common practice on Linux, where Python is often
installed in order to enable system tools, which, in turn, don't need
a Python package manager to function. Not sure why this would be the
case in MS Windows.

On Thu, Mar 21, 2024 at 4:51 PM Johanne Fairchild via Python-list
 wrote:
>
> Why is a whl-package called a ``wheel''?  Is it just a pronunciation for
> the extension WHL or is it really a name?
>
> Also, it seems that when I install Python on Windows, it doesn't come
> with pip ready to run.  I had to say
>
>   python -m ensurepip
>
> and then I saw that a pip on a whl-package was installed.  Why doesn't
> the official distribution make pip ready to run by default?  Thank you!
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Popping key causes dict derived from object to revert to object

2024-03-21 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2024-3-21 10:56 +0100:
> ...
>So as I understand it, I need to convert the InstanceState-objects to,
>say, dicts, in order to print them.  However I also want to remove one
>of the keys from the output and assumed I could just pop it off each
>event dict, thus:
>
>event_dicts = [vars(e) for e in events]
>print(type(event_dicts[0]))
>event_dicts = [e.pop('_sa_instance_state', None) for e in event_dicts]
>print(type(event_dicts[0]))
>
>However, this prints
>
>  

`vars` typically returns a `dict`.

>  
This is what you have popped.
>
>If I comment out the third line, which pops the unwanted key, I get
Then you do not change `event_dicts`.

You problem likely is:
`pop` does not return the `dict` after the removal of a key
but the removed value.
-- 
https://mail.python.org/mailman/listinfo/python-list


the name ``wheel''

2024-03-21 Thread Johanne Fairchild via Python-list
Why is a whl-package called a ``wheel''?  Is it just a pronunciation for
the extension WHL or is it really a name?

Also, it seems that when I install Python on Windows, it doesn't come
with pip ready to run.  I had to say

  python -m ensurepip

and then I saw that a pip on a whl-package was installed.  Why doesn't
the official distribution make pip ready to run by default?  Thank you!
-- 
https://mail.python.org/mailman/listinfo/python-list


Popping key causes dict derived from object to revert to object

2024-03-21 Thread Loris Bennett via Python-list
Hi,

I am using SQLAlchemy to extract some rows from a table of 'events'.
>From the call to the DB I get a list of objects of the type

  sqlalchemy.orm.state.InstanceState

I would like to print these rows to the terminal using the 'tabulate'
package, the documentation for which says

  The module provides just one function, tabulate, which takes a list of
  lists or another tabular data type as the first argument, and outputs
  a nicely formatted plain-text table

So as I understand it, I need to convert the InstanceState-objects to,
say, dicts, in order to print them.  However I also want to remove one
of the keys from the output and assumed I could just pop it off each
event dict, thus:
 
event_dicts = [vars(e) for e in events]
print(type(event_dicts[0]))
event_dicts = [e.pop('_sa_instance_state', None) for e in event_dicts]
print(type(event_dicts[0]))

However, this prints

  
  

If I comment out the third line, which pops the unwanted key, I get

  

  


Why does popping one of the keys cause the elements of the list to
revert back to their original class?

Cheers,

Loris

-- 
This signature is currently under constuction.
-- 
https://mail.python.org/mailman/listinfo/python-list