On Tue, 20 Oct 2020 at 16:12, Marco Sulla
wrote:
> tp_name of your class should include the module name.
>>
>
> It will be done :-)
>
It was the name... Thank you a lot!
--
https://mail.python.org/mailman/listinfo/python-list
I read these three C api functions, They are similar, because they all
construct a tuple[1].
IMHO, Py_BuildValue is more simple to use than PyTuple_Pack that is more
simple to use than PyTuple_New.
Where to use one or the other? What's the relative performance of the three
functions?
[1] actuall
Good, thank you a lot again.
--
https://mail.python.org/mailman/listinfo/python-list
I'm working on a C extension for frozendict. To make it working, I had to:
1. add by hand the whole path of dictobject.c
(/home/marco/sources/cpython/Objects/dictobject.c)
2. add -DPy_BUILD_CORE
3. add the whole path of CPython includes
(/home/marco/sources/cpython/Include and so on)
This works o
Try to save it in a binary field on PG using hdf5:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_hdf.html
On Thu, 22 Oct 2020 at 11:29, Shaozhong SHI wrote:
> I found this last option is very interesting.
>
> Saving the dataframe to memory using StringIO
>
> htt
I would add that usually I do not recommend saving files on databases. I
usually save the file on the disk and the path and mime on a dedicated
table.
--
https://mail.python.org/mailman/listinfo/python-list
Never worked with ZFS, it sounds interesting. Anyway, IMHO it's much more
simple to save to disk also for debugging: you have not to extract the data
from the db if you need to inspect them.
On Thu, 22 Oct 2020 at 14:39, D'Arcy Cain wrote:
> On 10/22/20 7:23 AM, Marco Sulla wrote
On Thu, 22 Oct 2020 at 18:31, Julio Di Egidio wrote:
> why
> only if there are abstract methods defined in an ABC
> class is instantiation disallowed?
>
Not sure because I never tried or needed, but if no @abstractsomething in A
is defined and your B class is a subclass of A, B should be an abst
On Thu, 22 Oct 2020 at 22:09, Marco Sulla
wrote:
> Not sure because I never tried or needed, but if no @abstractsomething in
> A is defined and your B class is a subclass of A, B should be an abstract
> class, not a concrete class.
>
Now I'm sure:
>>> from abc
If you read the documentation, there's a `bias` bool parameter.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 2 Dec 2020 at 04:13, Álvaro d'Ors wrote:
>
> Hi guys, I'm new here, can anyone help me built a bot than can input data
> in a website?
I never used it, but you can try Chatterbot:
https://chatterbot.readthedocs.io/en/stable/
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 3 Dec 2020 at 14:12, Shaozhong SHI wrote:
>
> We have been running Jupyter Notebook processes, which take long time to
> run.
>
> We use nbconvert to run these in commandline. Nbconvert only writes output
> into a file at the end.
>
> We just wonder whether there is a way to observe the p
Not sure why you want to do this (it's schoolwork)? Anyway, this is my version:
word = input('input word you want to change letters in: ')
chars = tuple(word)
change_this = input('Enter the letters you want to change: ')
replace_with = input('Enter the letters to replace with: ')
if len(change_t
You can return dictionaries that returns True if
(a.items() & kwargs.items()) == kwargs.items()
when `a` is one of your dicts.
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 8 Dec 2020 at 00:10, dn via Python-list wrote:
> The translation phase is most easily achieved with the built-in
> str.translate()
I forgot it :-)
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 7 Dec 2020 at 23:35, Larry Martell wrote:
>
> On Mon, Dec 7, 2020 at 5:29 PM Marco Sulla
> wrote:
> >
> > You can return dictionaries that returns True if
> >
> > (a.items() & kwargs.items()) == kwargs.items()
> >
> > when `a` is one of
On Mon, 7 Dec 2020 at 20:38, Tito Sanò wrote:
> Is it possible to get better performance in Python?
Have you installed BLAS for Scipy? What OS do you have?
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
>
> I'd like to check if there's "@" in a string and wondering if any method
> is better/safer than others. I was told on one occasion that I should
> use is than ==, so how would be on this example.
>
> s = 't...@mail.is'
You could do simply
if "@"
Try this:
>>> animal = ['koala', 'kangaroo']
>>> fruit = ['banana', 'apple']
>>> words = {'animals': animal, 'fruits': fruit}
>>> kinds = tuple(words.keys())
>>> kind = random.choice(kinds)
>>> kind
'animals'
>>> word = random.choice(words[kind])
>>> word
'koala'
--
https://mail.python.org/mailma
> That's a very superficial similarity: a list ['a', 'b', 'x', 'y'] is
> something like a mapping {0: 'a', 1: 'b', 2: 'x', 3: 'y'}. Seems logical,
> since in both cases we write collection[2] and get 'x' back.
>
> But think about it a bit more, and you will see that the behaviour is in
> fact *very
Peter Otten wrote:
>> I noticed that the sequence types does not have these methods that the
map
>> types has: get(), items(), keys(), values().
>> It could seem useless to have them for sequences, but I think it will
ease
>> the creation of functions and methods that allow you to input a generic
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
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
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
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
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
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
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
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
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
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
>
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
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",
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
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
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
ven
repository...
On Sun, 26 May 2019 at 15:37, Bischoop wrote:
> On 2019-05-19, Marco Sulla wrote:
> >blablabla
> >blablablalbla
> >blablalblalbalblabla
>
> There's no perfect language mate, in some one is easier in other not,
> normal surprised you notice it
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 practic
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
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
>
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
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
, repeat(args, times))
On Tue, 24 Dec 2019 at 21:41, Marco Sulla wrote:
>
> 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 t
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
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
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
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
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
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
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
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
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
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
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
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.
>
>
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
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
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
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
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
Mon, 9 Mar 2020 at 22:36, Marco Sulla wrote:
>
> 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 suppo
*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
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
201 - 263 of 263 matches
Mail list logo