Re: Weak Type Ability for Python

2023-04-15 Thread Peter J. Holzer
On 2023-04-13 03:28:37 +0100, MRAB wrote: > On 2023-04-13 03: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. > > > In the case of Perl, there are distinct operators for

Re: Weak Type Ability for Python

2023-04-15 Thread Peter J. Holzer
On 2023-04-14 10:19:03 +1000, Chris Angelico wrote: > The entire Presentation Manager and Workplace Shell (broadly > equivalent to a Linux "desktop manager", I think? Kinda?) were object > oriented; you would have a WPDataFile for every, well, data file, but > some of those might be subclasses of

RE: Weak Type Ability for Python

2023-04-14 Thread avi.e.gross
r Sent: Friday, April 14, 2023 12:23 AM To: python-list@python.org Subject: Re: Weak Type Ability for Python On Thu, 13 Apr 2023 20:53:21 -0400, Richard Damon declaimed the following: >On 4/13/23 7:25 PM, avi.e.gr...@gmail.com wrote: >> s there any concept in Python of storing informat

Re: Weak Type Ability for Python

2023-04-14 Thread Dennis Lee Bieber
{one more entry in the thread drift, and then I think I'll shut up} On Fri, 14 Apr 2023 17:22:47 +1000, Chris Angelico declaimed the following: >Yeah, the "ADDRESS" command has so much potential. Back in the day, I >built a MUD with REXX scripting, and within those scripts, the

Re: Weak Type Ability for Python

2023-04-14 Thread Chris Angelico
On Fri, 14 Apr 2023 at 17:17, Dennis Lee Bieber wrote: > > On Fri, 14 Apr 2023 05:35:22 +1000, Chris Angelico > declaimed the following: > > >It was quite the experience back in the day (as OS/2's native > >scripting language), and one that I'm truly glad to have had, as it > >taught me so much

Re: Weak Type Ability for Python

2023-04-14 Thread Dennis Lee Bieber
On Fri, 14 Apr 2023 05:35:22 +1000, Chris Angelico declaimed the following: >It was quite the experience back in the day (as OS/2's native >scripting language), and one that I'm truly glad to have had, as it >taught me so much about the differences between languages. > I still miss the

Re: Weak Type Ability for Python

2023-04-14 Thread Dennis Lee Bieber
On Thu, 13 Apr 2023 20:53:21 -0400, Richard Damon declaimed the following: >On 4/13/23 7:25 PM, avi.e.gr...@gmail.com wrote: >> s there any concept in Python of storing information in some way, such as >> text, and implementing various ideas or interfaces so that you can query if >> the contents

RE: RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
of what is stored for any shoppers wondering if you are compatible with their needs. -Original Message- From: Python-list On Behalf Of 2qdxy4rzwzuui...@potatochowder.com Sent: Thursday, April 13, 2023 10:27 PM To: python-list@python.org Subject: Re: RE: Weak Type Ability for Python On 2023-04

Re: Weak Type Ability for Python

2023-04-13 Thread Thomas Passin
On 4/13/2023 10:14 PM, avi.e.gr...@gmail.com wrote: Alan, Your guess is not quite what I intended. Something like a C union is just a piece of memory large enough to hold one of several kinds of content and some way to figure out which is currently in place. I am looking at a data structure

Re: RE: Weak Type Ability for Python

2023-04-13 Thread 2QdxY4RzWzUUiLuE
On 2023-04-13 at 22:14:25 -0400, avi.e.gr...@gmail.com wrote: > I am looking at a data structure that is an object of some class and > stores the data in any way that it feels like. But it may be a bit of > a chameleon that shows one face or another as needed. I can write code > now that simply

RE: RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
context albeit may be implemented in some projects to bridge things as described or in other novel ways. -Original Message- From: Alan Gauld Sent: Thursday, April 13, 2023 8:14 PM To: avi.e.gr...@gmail.com; python-list@python.org Subject: Re: RE: Weak Type Ability for Python On 14/04/

Re: Weak Type Ability for Python

2023-04-13 Thread Greg Ewing via Python-list
On 14/04/23 4:55 am, avi.e.gr...@gmail.com wrote: While we are at it, why stop with imaginary numbers when you can imagine extensions thereof? Unfortunately, it has been proven there are and can only be two additional such constructs. You can go beyond that if you broaden your horizons enough.

Re: Weak Type Ability for Python

2023-04-13 Thread Richard Damon
On 4/13/23 7:25 PM, avi.e.gr...@gmail.com wrote: s there any concept in Python of storing information in some way, such as text, and implementing various ideas or interfaces so that you can query if the contents are willing and able to be viewed in one of many other ways? There is nothing that

Re: Weak Type Ability for Python

2023-04-13 Thread Peter J. Holzer
On 2023-04-13 08:25:51 -0700, Grant Edwards wrote: > On 2023-04-13, 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. > >

Re: Weak Type Ability for Python

2023-04-13 Thread Chris Angelico
On Fri, 14 Apr 2023 at 09:49, Alan Gauld wrote: > > On 13/04/2023 20:35, Chris Angelico wrote: > > > REXX - where everything is a string, > > > It was quite the experience back in the day (as OS/2's native > > scripting language), > > I briefly met REXX on a mainframe, but I did play with OS/2

Re: RE: Weak Type Ability for Python

2023-04-13 Thread Alan Gauld
On 14/04/2023 00:25, avi.e.gr...@gmail.com wrote: > Is there any concept in Python of storing information in some way, such as > text, and implementing various ideas or interfaces so that you can query if > the contents are willing and able to be viewed in one of many other ways? Are you talking

Re: Weak Type Ability for Python

2023-04-13 Thread Alan Gauld
On 13/04/2023 20:35, Chris Angelico wrote: > REXX - where everything is a string, > It was quite the experience back in the day (as OS/2's native > scripting language), I briefly met REXX on a mainframe, but I did play with OS/2 for a year or two. Back when it looked like it might be a rival

RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
: Python-list On Behalf Of Chris Angelico Sent: Thursday, April 13, 2023 3:35 PM To: python-list@python.org Subject: Re: Weak Type Ability for Python On Fri, 14 Apr 2023 at 03:29, Dennis Lee Bieber wrote: > > On Thu, 13 Apr 2023 12:21:58 +1000, Cameron Simpson > declaimed the

Re: Weak Type Ability for Python

2023-04-13 Thread gene heskett
On 4/13/23 13:34, Dennis Lee Bieber wrote: On Thu, 13 Apr 2023 12:21:58 +1000, Cameron Simpson declaimed the following: 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

Re: Weak Type Ability for Python

2023-04-13 Thread Chris Angelico
On Fri, 14 Apr 2023 at 03:29, Dennis Lee Bieber wrote: > > On Thu, 13 Apr 2023 12:21:58 +1000, Cameron Simpson > declaimed the following: > > >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

Re: Weak Type Ability for Python

2023-04-13 Thread Chris Angelico
On Fri, 14 Apr 2023 at 02:55, wrote: > And, yes, you can use these critters in python. You can add a quaternion > type to numpy for example. Yep, octonions too. Hang on hang on hang on. I can multiply a string by an onion? The possibilities of script-controlled culinary arts just became that

Re: Weak Type Ability for Python

2023-04-13 Thread Thomas Passin
On 4/13/2023 2:36 PM, avi.e.gr...@gmail.com wrote: But having precedence rules and also allowing the other methods, should work fine for a good segment of people except perhaps the ones who like Reverse Polish Notation and insist on 5 4 3 + * instead. For *reading*, I prefer the usual 5 * (4 +

RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
perhaps the ones who like Reverse Polish Notation and insist on 5 4 3 + * instead. -Original Message- From: Python-list On Behalf Of aapost Sent: Thursday, April 13, 2023 12:28 PM To: python-list@python.org Subject: Re: Weak Type Ability for Python On 4/12/23 04:03, Ali Mohseni Roodbari wrote

Re: Weak Type Ability for Python

2023-04-13 Thread 2QdxY4RzWzUUiLuE
On 2023-04-12 at 22:47:17 -0400, Dennis Lee Bieber wrote: > REXX -- where everything is considered a string until it needs to be > something else. I see your REXX, and raise you an awk,¹ except that awk won't add a string to a number, or a number to string, but it will concatenate in both

Re: Weak Type Ability for Python

2023-04-13 Thread aapost
On 4/12/23 04:03, Ali Mohseni Roodbari wrote: > On 4/13/23 07:50, Stefan Ram wrote: >If tomorrow Python would allow "string+int" and "int+string" >in the sense of "string+str(int)" and "str(int)+string", >what harm would be there? > >But for now, I think a typical approach would

Re: Weak Type Ability for Python

2023-04-13 Thread Dennis Lee Bieber
On Thu, 13 Apr 2023 12:21:58 +1000, Cameron Simpson declaimed the following: >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.

RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
all kinds of things that MAY on examination turn out to be convertible to an integer or double. -Original Message- From: Python-list On Behalf Of Chris Angelico Sent: Thursday, April 13, 2023 12:12 PM To: python-list@python.org Subject: Re: Weak Type Ability for Python On Fri, 14 Apr

Re: Weak Type Ability for Python

2023-04-13 Thread Chris Angelico
On Fri, 14 Apr 2023 at 02:05, wrote: > So why not extend it to allow complex numbers? > > >>> "Hello" * complex(5,0) > TypeError: can't multiply sequence by non-int of type 'complex' > >>> "Hello" * complex(0,5) > TypeError: can't multiply sequence by non-int of type 'complex' > Clearly a missed

RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
ris Angelico Sent: Thursday, April 13, 2023 3:02 AM To: python-list@python.org Subject: Re: Weak Type Ability for Python On Thu, 13 Apr 2023 at 15:40, wrote: > And, no, I do not suggest 2.5 be interpreted as putting in an > approximate percentage so that .8 * "Hello" should result in "

Re: Weak Type Ability for Python

2023-04-13 Thread Grant Edwards
On 2023-04-13, 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. So does PHP. What's

Re: Weak Type Ability for Python

2023-04-13 Thread Thomas Passin
On 4/13/2023 1:38 AM, avi.e.gr...@gmail.com wrote: In Python, "+" does not mean plus at all. It means whatever the programmer wanted it to mean. An infix line of code that includes "obj1 + obj2" is supposed to investigate how to do it. I am not sure if some built-in objects may be different, but

Re: Weak Type Ability for Python

2023-04-13 Thread J. Pic
print(f'{x}{y}') ? On Wed, Apr 12, 2023 at 7:06 PM Ali Mohseni Roodbari < ali.mohseniroodb...@gmail.com> 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

Re: Weak Type Ability for Python

2023-04-13 Thread Chris Angelico
On Thu, 13 Apr 2023 at 15:40, wrote: > And, no, I do not suggest 2.5 be interpreted as putting in an > approximate percentage so that .8 * "Hello" should result in "Hell" ... $ pike Pike v8.1 release 15 running Hilfe v3.5 (Incremental Pike Frontend) Ok. > "Hello, world! " * 2.5; (1) Result:

RE: Weak Type Ability for Python

2023-04-12 Thread avi.e.gross
gument here in arguing it should accept a float and truncate it. But since you can easily cast a float to an int, in any of many ways, why have the program choose when it quite likely reflects an error in the code. And, no, I do not suggest 2.5 be interpreted as putting in an approximate percentag

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 --

RE: Weak Type Ability for Python

2023-04-12 Thread avi.e.gross
in a new language is to work within the existing language as-is and not to ask the language to change to be the way you want. That can take years or never happen, and especially if the designers did not want the feature you ask for. -Original Message- From: Python-list On Behalf Of

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
thon does not generally choose that as it is quite easy to use one of so many methods, and lately an f-string is an easy way as others mentioned. -Original Message- From: Python-list On Behalf Of Thomas Passin Sent: Wednesday, April 12, 2023 2:52 PM To: python-list@python.org Subject: Re

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

RE: Weak Type Ability for Python

2023-04-12 Thread avi.e.gross
, 2023 2:52 PM To: python-list@python.org Subject: Re: Weak Type Ability for Python 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): >> >>

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

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

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.

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:

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,