Embedded python is not 100% stable

2023-04-13 Thread Guenther Sohler
Hi Python LIst, I have been working on adding embedded python into OpenSCAD ( www.openscad.org) for some time already. For that i coded/added an additional Python Type Object which means to hold openscad geometric data. It works quite well but unfortunately its not 100% stable and i have been

Re: for a 'good python'

2023-04-13 Thread Lars Liedtke
Lars Liedtke Software Entwickler [Tel.] +49 721 98993- [Fax] +49 721 98993- [E-Mail]l...@solute.de solute GmbH Zeppelinstraße 15 76185 Karlsruhe Germany [Logo Solute] Marken der solute GmbH | brands of solute GmbH [Marken] [Advertising Partner]

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-13 Thread avi.e.gross
Can I bring a part of this discussion a bit closer to Python? I stipulate that quite a few languages, including fairly early ones, treated text often as numbers. Ultimately, much of programming is about taking in text and often segregating parts into various buckets either explicitly or by

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: Embedded python is not 100% stable

2023-04-13 Thread Dieter Maurer
Guenther Sohler wrote at 2023-4-13 09:40 +0200: > ... >I have been working on adding embedded python into OpenSCAD ( >www.openscad.org) >for some time already. For that i coded/added an additional Python Type >Object >which means to hold openscad geometric data. > >It works quite well but

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 avi.e.gross
Chris, I was not suggesting it for Python as one of many possible implementations. I do see perfectly valid uses in other contexts. For example, if I have a program that displays my text as pixels in some font and size, I may indeed want the text clipped at 2 1/2 repetitions. But as always, when

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: for a 'good python'

2023-04-13 Thread Barry
 > On 13 Apr 2023, at 00:19, jak wrote: > > 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'

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 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: 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 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 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: 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: RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
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 that is an object of some class and stores the data

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: 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: 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: RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
Yes, Dave, there are many data structures that can be used to maintain a list of output types the class claims to support. Dictionaries have the interesting property that you can presumably have a value that holds a member function to access the way the key specifies. Ideally, the order is not

Re: Embedded python is not 100% stable

2023-04-13 Thread aapost
On 4/13/23 03:40, Guenther Sohler wrote: Attachments are stripped, so they weren't included. Glancing at the branch and the 2 lines you mentioned. You have a comment with a link for python 2.3 documentation. Yet you have python 3.10 code included elsewhere (and openscad itself requires the

RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
This reminds me a bit of complaints that the parser does not do what you want when you do not supply parentheses in an expression like: 5 * 4 + 3 In many and maybe most languages it is seen as (5*4)+3 UNLESS you tell it you want 5*(4+3). There are precedence and associativity rules. Of course

Problem with Matplotlib example

2023-04-13 Thread Martin Schöön
Anyone had success running this example? https://tinyurl.com/yhhyc9r When I try I get this error: "TypeError: __init__() got an unexpected keyword argument 'transform'" This is for the line "m = MarkerStyle(SUCESS_SYMBOLS[mood], transform=t)" Yes, I know, I could dive into the documentation

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: for a 'good python'

2023-04-13 Thread jak
Dennis Lee Bieber ha scritto: On Thu, 13 Apr 2023 00:21:58 +0200, jak declaimed the following: Thank you too. I had seen this library but I always try not to use libraries outside the standard ones. Now I don't remember why I was convinced that this wasn't part of it, perhaps because it was

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: for a 'good python'

2023-04-13 Thread Dennis Lee Bieber
On Thu, 13 Apr 2023 00:21:58 +0200, jak declaimed the following: >Thank you too. I had seen this library but I always try not to use >libraries outside the standard ones. Now I don't remember why I was >convinced that this wasn't part of it, perhaps because it was like that >at the time or

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 avi.e.gross
[THIS CLAIMER: a bit off a bit off a bit off topic, imagine that] Chris, You have a gift of taking things I think about but censor myself from including in my post and then blurting it out! LOL! The original question in this thread now seems a dim memory but we are now discussing not how to add

Hide my query about covariance matrix syntax from google

2023-04-13 Thread Meghna Karkera
Respected Sir I kindly request you to hide my query about covariance matrix syntax from google which was emailed to you a few years back as it appears on google page. Hoping that you do the needful. Dr. Meghna Raviraj Karkera -- https://mail.python.org/mailman/listinfo/python-list

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: Hide my query about covariance matrix syntax from google

2023-04-13 Thread Chris Angelico
On Fri, 14 Apr 2023 at 03:11, Meghna Karkera wrote: > > Respected Sir > > I kindly request you to hide my query about covariance matrix syntax from > google which was emailed to you a few years back as it appears on google > page. > > Hoping that you do the needful. These posts are public. While

Re: Problem with Matplotlib example

2023-04-13 Thread Thomas Passin
On 4/13/2023 2:41 PM, Martin Schöön wrote: Anyone had success running this example? https://tinyurl.com/yhhyc9r When I try I get this error: "TypeError: __init__() got an unexpected keyword argument 'transform'" This is for the line "m = MarkerStyle(SUCESS_SYMBOLS[mood], transform=t)"

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 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: Problem with Matplotlib example

2023-04-13 Thread MRAB
On 2023-04-13 19:41, Martin Schöön wrote: Anyone had success running this example? https://tinyurl.com/yhhyc9r When I try I get this error: "TypeError: __init__() got an unexpected keyword argument 'transform'" This is for the line "m = MarkerStyle(SUCESS_SYMBOLS[mood], transform=t)" Yes,