Re: Suggestion: make sequence and map interfaces more similar

2016-03-29 Thread Marco Sulla via Python-list
On 29 March 2016 at 16:31, Chris Angelico wrote: > But the definition of a sequence, and likewise the definition of a > mapping, goes deeper than that. A sequence has *relative* stability; > if one item is at a lower index than another, it will continue to be > at a lower index, until you change o

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Marco Sulla via Python-list
On 30 March 2016 at 02:55, Terry Reedy wrote: > To me [seq.items() and seq.keys()] are useless and confusing duplications > since enumerate()(seq) > and range(len(seq)) are quite different from dict.items and dict.keys. It's true. Indeed IMHO it's enumerate() that will be a confusing duplication

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Marco Sulla via Python-list
Let me also add that even if it seems that my idea will not break any official contracts, I can create a new ABC class and let maps and sequence types inherit from it. IMHO it's absolutely not needed, but at least the discussion will be no more distracted my secondary considerations, since the main

Re: Suggestion: make sequence and map interfaces more similar

2016-03-31 Thread Marco Sulla via Python-list
On 31 March 2016 at 04:40, Steven D'Aprano wrote: > Enough of the hypothetical arguments about what one could do or might do. > Let's see a concrete example of actual real world code used in production, > not a mickey-mouse toy program, where it is desirable that adding or > deleting one key will

Re: Suggestion: make sequence and map interfaces more similar

2016-03-31 Thread Marco Sulla via Python-list
I want also to add that we are focusing on sequences, but my proposal is also to make map interface more similar, introducing a vdict type that iterates over values, and this will be for me really more practical. PEP 234 ( http://legacy.python.org/dev/peps/pep-0234/ ) never convinced me. Van Rossu

Re: Why not allow empty code blocks?

2016-07-24 Thread Marco Sulla via Python-list
On 24 July 2016 at 14:48, Chris Angelico wrote: > Maybe the people who are most worried about this can enact a > simple rule: no dedent without a blank line? That can easily be > verified by a script, and it'd protect against most of the given > examples. It's not too much effort (after any reason

Re: How asyncio works? and event loop vs exceptions

2016-07-25 Thread Marco Sulla via Python-list
On 23 July 2016 at 16:06, Ian Kelly wrote: > On Fri, Jul 22, 2016 at 6:27 PM, Marco S. via Python-list > wrote: >> Furthermore I have a question about exceptions in asyncio. If I >> understand well how it works, tasks exceptions can be caught only if >> you wait for task completion, with yield fr

Python slang

2016-08-05 Thread Marco Sulla via Python-list
I have a simple curiosity: why Python has much keywords, and some builtin types and methods, that are different from the other languages? What is the rationale? I'm referring to: * `except` instead of `catch` * `raise` instead of `throw` * `self` instead of `this` (I know, it's not enforced, but i

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 00:31, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 8:00 AM, Marco Sulla via Python-list > wrote: > This isn't slang; it's jargon Right. >> * `raise` instead of `throw` > > Quite a few other languages talk about raising exceptions rather th

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 20:03, Michael Selik wrote: > On Sat, Aug 6, 2016, 10:10 AM Marco Sulla via Python-list > wrote: >> >> On 6 August 2016 at 00:31, Chris Angelico wrote: >> > "map" has many other meanings (most notably the action wherein you >

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 02:13, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 9:21 AM, Marco Sulla > wrote: >> I want to clarify that when I say "different from the other >> languages", I mean "different from the most used languages", that in >> my mind are C/C++, C#, Java, PHP and Javascript, mainly

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 03:14, Steven D'Aprano wrote: > On Sat, 6 Aug 2016 08:00 am, Marco Sulla wrote: >> I'm referring to: >> * `except` instead of `catch` > > Because this isn't a game of "catch the ball". They're called "exceptions", > not "catchions". You *try* something, and if an *exception* ha

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 03:35, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 11:14 AM, Steven D'Aprano > wrote: >>> I don't ask about `None` instead of `null` because I suppose here it's >>> a matter of disambiguation (null, in many languages, is not equal to >>> null). >> >> Really? Which languages

Why Python has no equivalent of JDBC of Java?

2019-05-19 Thread Marco Sulla via Python-list
I programmed in Python 2 and 3 for many years, and I find it a fantastic language. Now I'm programming in Java by m ore than 2 years, and even if I found its code much more boilerplate, I admit that JDBC is fantastic. One example over all: Oracle. If you want to access an Oracle DB from Python, y

Re: Why Python has no equivalent of JDBC of Java?

2019-05-20 Thread Marco Sulla via Python-list
On Mon, 20 May 2019 at 17:32, Thomas Jollans wrote: > Python has a the "Python Database API" (DB API 2.0) > https://www.python.org/dev/peps/pep-0249/ > So why Oracle need instantclient for using cx_Oracle? They say they use DB-API: > *cx_Oracle* is a Python extension module that enables access

Re: Why Python has no equivalent of JDBC of Java?

2019-06-16 Thread Marco Sulla via Python-list
On Tue, 21 May 2019 at 01:20, Michael Torrie wrote: > On 05/20/2019 04:23 PM, Andrew Z wrote: > I assume > Nope, it requires the instantclient and, on Linux only, also the installclient-devel package. And a bunch of obscure and terrible settings, like LD_LIBRARY_PATH... On Tue, 21 May 2019 at 0

Re: Most elegant way to do something N times

2019-12-24 Thread Marco Sulla via Python-list
On Tue, 24 Dec 2019 at 01:07, Chris Angelico wrote: > On Tue, Dec 24, 2019 at 10:45 AM Marco Sulla <...> wrote: > > ??? Excuse me, but why you needed to call the same function SIX times? This > > seems to me not elegant in primis. > > > > Can you give us a practical example? > > File parsing. You

Re: Lists And Extra Commas at end

2019-12-24 Thread Marco Sulla via Python-list
On Tue, 24 Dec 2019 at 22:51, Avi Gross via Python-list wrote: > So, is that a feature you want warnings about? After all, a dangling comma > may simply mean you left something out and meant to add later? .completely OT. I responded to a topic named "List and missing commas", and suggested a

Re: Lists And Missing Commas

2019-12-24 Thread Marco Sulla via Python-list
On Tue, 24 Dec 2019 at 19:05, Avi Gross via Python-list wrote: > There are some lint programs that check your code and supply warnings and I > see some languages have the option to generate warnings when the two strings > are on the same line. I wonder if a Python lint does that. It may at least >

Re: More efficient/elegant branching

2019-12-24 Thread Marco Sulla via Python-list
I agree with Chris Angelico, branch1 is "the way to go". Maybe you have to add a default at start, maybe None, and maybe raise an exception if res is None. Anyway, despite I'm a pain in the... arse and I usually activate ALL the possible warnings in the world, I always disable cyclomatic complexity

Re: Lists And Extra Commas at end

2019-12-24 Thread Marco Sulla via Python-list
On Wed, 25 Dec 2019 at 00:56, Avi Gross wrote: > I may not be understanding what you are objecting to I, sir, am objecting that I replied to a topic, and you answered to me, but in another topic. You could have respond to me in the correct topic, and then create this other one (that I'm not real

Re: Most elegant way to do something N times

2019-12-24 Thread Marco Sulla via Python-list
Anyway, from itertools recipes: def repeatfunc(func, times=None, *args): """Repeat calls to func with specified arguments. Example: repeatfunc(random.random) """ if times is None: return starmap(func, repeat(args)) return starmap(func, repeat(args, times)) On Tue, 24

Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-01 Thread Marco Sulla via Python-list
As title. Currently I'm using gcc 9.2.0 and its compilation seems to work well and fast. But I would know by your experience if clang can produce, on a *nix system, a "faster Python". -- https://mail.python.org/mailman/listinfo/python-list

Re: Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-01 Thread Marco Sulla via Python-list
Good! Have you compiled it optimized (--enable-optimizations --with-lto)? On Sun, 1 Mar 2020 at 23:48, Skip Montanaro wrote: > > > As title. Currently I'm using gcc 9.2.0 and its compilation seems to > > work well and fast. But I would know by your experience if clang can > > produce, on a *nix s

Re: Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-02 Thread Marco Sulla via Python-list
Oooohhh uff, I have to install latest clang... or better, compile it as I did for gcc. And I have to read the install docs to see if there's some trick to optimize it... and I have to read the docs of pyperformance too (I only used pyperf until now)... Oh well, tomorrow :-D On Mon, 2 Mar 2020

Re: Data model and attribute resolution in subclasses

2020-03-02 Thread Marco Sulla via Python-list
On Fri, 28 Feb 2020 at 08:28, Adam Preble wrote: > > I have been making some progress on my custom interpreter project Is your project published somewhere? What changes have you done to the interpreter? -- https://mail.python.org/mailman/listinfo/python-list

Why this message was rejected?

2020-03-02 Thread Marco Sulla via Python-list
One of my post on this list was rejected. The reason is: > Blind carbon copies or other implicit destinations are not allowed. >Try reposting your message by explicitly including the list address in > the To: or Cc: fields. I rechecked my mail and I added the user to the To: field, and the python

Re: Why this message was rejected?

2020-03-02 Thread Marco Sulla via Python-list
On Mon, 2 Mar 2020 at 22:36, Ethan Furman wrote: > Questions like this should go to python-list-owner at python dot org. If > this message hadn't been flagged we may not have noticed it. Sorry, I posted to python-list-owner before reading this message. > When the mailing list software received

Re: Why this message was rejected?

2020-03-02 Thread Marco Sulla via Python-list
Ok, I sent a message as I did before to the discussion "Re: Friday Finking: Poly more thick", with only "test" as body. On Mon, 2 Mar 2020 at 22:48, Marco Sulla wrote: > > On Mon, 2 Mar 2020 at 22:36, Ethan Furman wrote: > > Questions like this should go to python-list-owner at python dot org

Why there's no __json__()?

2020-03-02 Thread Marco Sulla via Python-list
As title. For example, `copy.copy` can use the __copy__() method of a class, if defined. Is this not possible with `json`? -- https://mail.python.org/mailman/listinfo/python-list

`async def` breaks encapsulation?

2020-03-04 Thread Marco Sulla via Python-list
I worked a lot with `asyncio` many years ago, when `aiohttp` was first born. Now I'm working again with it, since a library that I need requires it. asyncio is much more simple to use now, but there's something that still make me doubtful: the require of the `async` keyword for coroutines. When I

Re: Help building python application from source

2020-03-04 Thread Marco Sulla via Python-list
Mh. I hoped not, but unluckily I expected a response like this. People of Python List, I strongly discourage you to support this user. He is quite suspicious for the following reasons: 1. he go so far as he offers money for, IMHO, a trivial task 2. he does not trust binaries from pip. He is so ca

Re: pip UX Studies - help improve the usability of pip

2020-03-10 Thread Marco Sulla via Python-list
Subscribed. I have a little suggestion IMHO "What is you favourite pip command or functionality?" is not very useful... of course the most useful command is "install" :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: pip UX Studies - help improve the usability of pip

2020-03-10 Thread Marco Sulla via Python-list
There's someone of the pip team that can confirm this? On Sat, 7 Mar 2020 at 02:49, Bernard Tyers - Sane UX Design wrote: > > Hi there, > > My name is Bernard Tyers. I'm a UX designer and have recently started > working on the PSF project to improve the usability of pip, funded by > MOSS/CZI. > >

Re: Error while installing a python code

2020-03-10 Thread Marco Sulla via Python-list
I suppose you tried to use this setup.py: https://github.com/breathe/coffee_conda_package/blob/master/0001-Add-alternative-setup.py-script.patch It's not well written IMHO... anyway this is not the problem. I suppose you also downloaded the required sources from here: https://data.mendeley.com/da

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Marco Sulla via Python-list
I think that implementing TotallyOrderable and PartiallyOrderable is a good idea. But is it useful? I mean, I don't know how much people needs really to order sets. Maybe some mathematician. But they can simply use Sage: http://doc.sagemath.org/html/en/reference/categories/sage/categories/posets.ht

Re: [Python-ideas] Re: New explicit methods to trim strings

2020-03-10 Thread Marco Sulla via Python-list
I agree with Steven D'Aprano. I never had problems with strip(), but if people find it confusing, Python can simply leave strip() and all the other function as they are and add another functions, like crop() or snip() or shear() prune() or mow(). Personally I prefer crop() or prune(). This way the

Re: pip UX Studies - help improve the usability of pip

2020-03-10 Thread Marco Sulla via Python-list
On Mon, 9 Mar 2020 at 16:09, Paul Moore wrote: > We've had some questions as to whether this survey is legitimate. I > can confirm it is (speaking as a pip core developer). Thank you a lot! -- https://mail.python.org/mailman/listinfo/python-list

Re: Python question

2020-03-10 Thread Marco Sulla via Python-list
On Fri, 6 Mar 2020 at 17:30, Souvik Dutta wrote: > And you cannot form opinions for > other people's by saying them not to support a person. That is injustice > and rude. I would reply, but I was already too much off topic. I want only to write what Gmail reports to me about the last message of t

Re: Error while installing a python code

2020-03-10 Thread Marco Sulla via Python-list
Little errata: you have only to install or update Cython, remove the .c files as I wrote before and run again python setup.py build_ext -b PoissonSolver/ No intermediate steps are required. The generated ELF files are three. You have also to rename them with the names in the README file. On Mon

Re: Installation of python

2020-03-10 Thread Marco Sulla via Python-list
*Ahem* I already posted the solution to your problem. I quote myself: I suppose you also downloaded the required sources from here: https://data.mendeley.com/datasets/s2x4d542dc/1 It seems the problem is that the above sources are generated by an old version of Cython: https://github.com/mcfletc

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Marco Sulla via Python-list
On Tue, 10 Mar 2020 at 13:41, Chris Angelico wrote: > It makes good sense for > division by 0 and division by 0.0 to both result in the same > exception. But Python 3 returns a float, for example, in division between integers. 4 / 2 == 2.0. So some_integer / +0 should return +Infinity. This is wh