RE: Weak Type Ability for Python

2023-04-12 Thread avi.e.gross
Given the significant number of languages other than Python that have some version of a feature that allows implicit conversion of unlike operands to concatenate something like a "number" and a string into a string, the question may not be silly as to how or why Python chose as it chose. As I see

Re: Weak Type Ability for Python

2023-04-12 Thread Cameron Simpson
On 13Apr2023 03:36, MRAB wrote: I thought that in Java you can, in fact, concatenate a string and an int, so I did a quick search online and it appears that you can. I stand corrected. I could have sworn it didn't, but it has been a long time. - Cameron Simpson -- https://mail.python.org/ma

RE: Weak Type Ability for Python

2023-04-12 Thread avi.e.gross
On closer reading, the OP may be asking how to make a function doing what they want, albeit without a plus. Here is a python function as a one-liner that takes exactly two arguments of any kind (including string and integer) and concatenates them into one string without anything between and prints

Re: Weak Type Ability for Python

2023-04-12 Thread MRAB
On 2023-04-13 03:21, Cameron Simpson wrote: On 12Apr2023 22:12, avi.e.gr...@gmail.com wrote: I suspect the OP is thinking of languages like PERL or JAVA which guess for you and make such conversions when it seems to make sense. JavaScript guesses. What a nightmare. Java acts like Python and

Re: Weak Type Ability for Python

2023-04-12 Thread MRAB
On 2023-04-13 03:12, avi.e.gr...@gmail.com wrote: As originally written, the question posed has way too many possible answers but the subject line may give a hint. Forget printing. The Python statement 1 + "a" SHOULD fail. The first is an integer and the second is string. These two are native

Re: Weak Type Ability for Python

2023-04-12 Thread Cameron Simpson
On 12Apr2023 22:12, avi.e.gr...@gmail.com wrote: I suspect the OP is thinking of languages like PERL or JAVA which guess for you and make such conversions when it seems to make sense. JavaScript guesses. What a nightmare. Java acts like Python and will forbid it on type grounds (at compile t

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst
On 13/04/2023 12:00 pm, Eryk Sun wrote: On 4/12/23, Mike Dewhirst wrote: Collecting psycopg2==2.9.3 x86 and x64 wheels are available for Python 3.11 if you can use Psycopg 2 version 2.9.5 or 2.9.6 instead of 2.9.3: https://pypi.org/project/psycopg2/2.9.5/#files https://pypi.org/project/psycop

RE: Weak Type Ability for Python

2023-04-12 Thread avi.e.gross
As originally written, the question posed has way too many possible answers but the subject line may give a hint. Forget printing. The Python statement 1 + "a" SHOULD fail. The first is an integer and the second is string. These two are native Python objects that neither define what to do if the

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Eryk Sun
On 4/12/23, Mike Dewhirst wrote: > > Collecting psycopg2==2.9.3 x86 and x64 wheels are available for Python 3.11 if you can use Psycopg 2 version 2.9.5 or 2.9.6 instead of 2.9.3: https://pypi.org/project/psycopg2/2.9.5/#files https://pypi.org/project/psycopg2/2.9.6/#files -- https://mail.python

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread MRAB
On 2023-04-13 02:27, Mike Dewhirst wrote: On 12/04/2023 10:59 pm, Mike Dewhirst wrote: Sadly Windows is still in the dock. The jury is still out. Turns out the "without a hitch" was based on cached wheels. I'm going to start from scratch with new projects using Pythons 3.8, 3.10 and 3.11 and

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst
On 12/04/2023 10:59 pm, Mike Dewhirst wrote: Sadly Windows is still in the dock. The jury is still out. Turns out the "without a hitch" was based on cached wheels. I'm going to start from scratch with new projects using Pythons 3.8, 3.10 and 3.11 and report back. Report summary: pip install

Re: for a 'good python'

2023-04-12 Thread jak
Barry ha scritto:  On 12 Apr 2023, at 18:10, jak wrote: Hi everyone, some time ago I wrote a class to determine if an ipv4 address belonged to a subnet. Seldom using python I'm pretty sure it's not written in 'good python' nor too portable. Could you give me some advice to make it better?

Re: for a 'good python'

2023-04-12 Thread Barry
 > On 12 Apr 2023, at 18:10, jak wrote: > Hi everyone, > some time ago I wrote a class to determine if an ipv4 address belonged > to a subnet. Seldom using python I'm pretty sure it's not written in > 'good python' nor too portable. Could you give me some advice to make it > better? > > class

Re: Weak Type Ability for Python

2023-04-12 Thread 2QdxY4RzWzUUiLuE
On 2023-04-12 at 14:51:44 -0400, Thomas Passin wrote: > On 4/12/2023 1:11 PM, Chris Angelico wrote: > > On Thu, 13 Apr 2023 at 03:05, Ali Mohseni Roodbari > > wrote: > > > > > > Hi all, > > > Please make this command for Python (if possible): > > > > > > > > > x=1 > > > > > > y='a' > > > > > >

Re: Weak Type Ability for Python

2023-04-12 Thread Grant Edwards
On 2023-04-12, Ali Mohseni Roodbari wrote: > Hi all, > Please make this command for Python (if possible): > x=1 y='a' wprint (x+y) 1a If that's what you want, use PHP or some other language. Don't try to ruin Python. > In fact make a new type of print command which can print

Re: Weak Type Ability for Python

2023-04-12 Thread MRAB
On 2023-04-12 19:57, Mats Wichmann wrote: On 4/12/23 11:11, Chris Angelico wrote: On Thu, 13 Apr 2023 at 03:05, Ali Mohseni Roodbari wrote: Hi all, Please make this command for Python (if possible): x=1 y='a' wprint (x+y) 1a In fact make a new type of print command which can print and sho

Re: Weak Type Ability for Python

2023-04-12 Thread Thomas Passin
On 4/12/2023 1:11 PM, Chris Angelico wrote: On Thu, 13 Apr 2023 at 03:05, Ali Mohseni Roodbari wrote: Hi all, Please make this command for Python (if possible): x=1 y='a' wprint (x+y) 1a In fact make a new type of print command which can print and show strings and integers together. Try

Re: Weak Type Ability for Python

2023-04-12 Thread Mats Wichmann
On 4/12/23 11:11, Chris Angelico wrote: On Thu, 13 Apr 2023 at 03:05, Ali Mohseni Roodbari wrote: Hi all, Please make this command for Python (if possible): x=1 y='a' wprint (x+y) 1a In fact make a new type of print command which can print and show strings and integers together. Try: p

Re: Weak Type Ability for Python

2023-04-12 Thread Chris Angelico
On Thu, 13 Apr 2023 at 03:05, Ali Mohseni Roodbari wrote: > > Hi all, > Please make this command for Python (if possible): > > >>> x=1 > >>> y='a' > >>> wprint (x+y) > >>> 1a > > In fact make a new type of print command which can print and show strings > and integers together. > Try: print(x, y)

Re: for a 'good python'

2023-04-12 Thread jak
Stefan Ram ha scritto: jak writes: @property def subnet(self): return self.__to_str(self.__tsubnet) Maybe each of those attributes should be an object of a special class where your "__to_str" is "__str__"? E.g., # code in "calcip.__init__" self.tsubnet = ip_address_class.from_int(

Post Degree in Machine Learning | Job position at CMCC Foundation, Italy

2023-04-12 Thread info cmcc
*POST-DEGREE IN MACHINE LEARNING* [Job Opening Code: 12404] *Lecce (Italy) - Deadline: 15/04/2023* Our Division of Advanced Scientific Computing (ASC Division) is considering the possibility to hire a talented and proactive Post Degree candidate to support CMCC research activities. The contract w

for a 'good python'

2023-04-12 Thread jak
Hi everyone, some time ago I wrote a class to determine if an ipv4 address belonged to a subnet. Seldom using python I'm pretty sure it's not written in 'good python' nor too portable. Could you give me some advice to make it better? class calcip: def __init__(self, psubnet: str): ssu

Weak Type Ability for Python

2023-04-12 Thread Ali Mohseni Roodbari
Hi all, Please make this command for Python (if possible): >>> x=1 >>> y='a' >>> wprint (x+y) >>> 1a In fact make a new type of print command which can print and show strings and integers together. Sincerely yours, Ali. -- https://mail.python.org/mailman/listinfo/python-list

DIPY Workshop 2023 now to be held online! April 24-28.

2023-04-12 Thread Eleftherios Garyfallidis
Dear all, Due to unexpected events we have had to make the decision to transition our workshop to a virtual format. While this change was unexpected, we are well-prepared due to our previous experience with our own online platform. Rest assured, w

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Thomas Passin
On 4/12/2023 8:59 AM, Mike Dewhirst wrote: Sadly Windows is still in the dock. The jury is still out. Turns out the "without a hitch" was based on cached wheels. I'm going to start from scratch with new projects using Pythons 3.8, 3.10 and 3.11 and report back. Sorry for the length to come,

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst
Sadly Windows is still in the dock. The jury is still out. Turns out the "without a hitch" was based on cached wheels. I'm going to start from scratch with new projects using Pythons 3.8, 3.10 and 3.11 and report back. Cheers Mike On 12/04/2023 6:13 pm, Mike Dewhirst wrote: Well thank you

Re: Dataclasses, immutability(?), and ChatGPT

2023-04-12 Thread Thomas Passin
On 4/12/2023 12:58 AM, dn via Python-list wrote: Are dataclasses (or instances thereof) mutable or immutable? - and in what sense? Have been experimenting with ChatGPT. In particular: its possibilities as a trainer, good ideas for methods of introducing new topics, its capability for drawing-

Re: Dataclasses, immutability(?), and ChatGPT

2023-04-12 Thread Grant Edwards
On 2023-04-12, Roel Schroeven wrote: >> Huh? If we'd been discussing namedtuples over (say) dictionaries, I'd >> perhaps have accepted the reply. > > ChatGPT is wrong. > >> Anything I've 'missed'? >> - or a salutary tale of not depending upon ChatGPT etc? > You didn't miss anything, ChatGPT is

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst
Well thank you Christoph Gohlke and thank you Ian Bicking and colleagues. I just used pip to nakedly install psycopg2 and Pillow without a hitch. My distrust of Windows has kept me going back to Christoff's well for years. Maybe it is time to assume innocence unless proven guilty ;-) Thanks

Re: Dataclasses, immutability(?), and ChatGPT

2023-04-12 Thread Roel Schroeven
Op 12/04/2023 om 6:58 schreef dn via Python-list: Are dataclasses (or instances thereof) mutable or immutable? - and in what sense? Instances of dataclasses are mutable, just like normal classes. Dataclasses *are* normal classes, with some extra special methods. They are totally different from