[issue46086] Add ratio_min() function to the difflib library

2021-12-15 Thread Giacomo
New submission from Giacomo : Here I propose a new function, namely .ratio_min(self,m). .ratio_min(self,m) is an extension of the difflib's function .ratio(self). Equivalently to .ratio(self), .ratio_min(self,m) returns a measure of two sequences' similarity (float in [0,1]). In addition

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-26 Thread Giacomo Caironi
Giacomo Caironi added the comment: Ok but then why does it work in python3.8 and not in python 3.9? -- ___ Python tracker <https://bugs.python.org/issue42

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-26 Thread Giacomo Caironi
Giacomo Caironi added the comment: Why do you say that `getaddrinfo()` is called at the interpreter shutdown state? On my machine it works and the output is [(, , 6, '', ('216.58.208.132', 8333)), (, , 17, '', ('216.58.208.132', 8333)), (, , 0, '', ('216.58.208.132', 8333)), (, , 6

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-25 Thread Giacomo Caironi
New submission from Giacomo Caironi : import asyncio import traceback from threading import Thread class Test(Thread): def __init__(self): super().__init__() self.loop = asyncio.new_event_loop() async def getaddrinfo(self, loop): try: print(await

[issue39276] type() cause segmentation fault in callback function called from C extension

2020-01-12 Thread Giacomo Mazzamuto
Giacomo Mazzamuto added the comment: Hello, the segmentation fault is also resolved by finalizing the initialization of InternalType by calling PyType_Ready(), just like you do with ExternalType -- nosy: +Giacomo Mazzamuto ___ Python tracker

[issue23850] Missing documentation for Py_TPFLAGS_HAVE_NEWBUFFER

2015-04-02 Thread Giacomo Alzetta
Changes by Giacomo Alzetta giacomo.alze...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python type: - enhancement versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23850

[issue23850] Missing documentation for Py_TPFLAGS_HAVE_NEWBUFFER

2015-04-02 Thread Giacomo Alzetta
New submission from Giacomo Alzetta: Python2.7 documentation is missing critical information regarding the backporting of the new-buffer protocol. There is no mention whatsoever of the Py_TPFLAGS_HAVE_NEWBUFFER flag which is required to implement it. The only way to discover it is by reading

[issue21782] hashable documentation error: shouldn't mention id

2014-06-16 Thread Giacomo Alzetta
New submission from Giacomo Alzetta: The documentation for hashable in the glossary (https://docs.python.org/3.4/reference/datamodel.html#object.__hash__) is incorrect: they all compare unequal (except with themselves), **and their hash value is their id().** It is *not* true

[issue21782] hashable documentation error: shouldn't mention id

2014-06-16 Thread Giacomo Alzetta
Giacomo Alzetta added the comment: their hash value is their id() seems quite clearly stating that: class A: pass ... a = A() hash(a) == id(a) should be true, but: hash(a) == id(a) False (both in python2 and in python3) The python 2 documentation for the __hash__ special method *does

[issue20902] Which operand is preferred by set operations? Missing information in the documentation

2014-03-13 Thread Giacomo Alzetta
Giacomo Alzetta added the comment: I asked this because, for example, in Haskell it *is* a well-defined behaviour (see its documentation at: http://hackage.haskell.org/package/containers-0.5.4.0/docs/Data-Set.html): the left operand is preferred by all operations. In fact, working

[issue20902] Which operand is preferred by set operations? Missing information in the documentation

2014-03-12 Thread Giacomo Alzetta
New submission from Giacomo Alzetta: Currently the documentation for set (at: http://docs.python.org/2/library/stdtypes.html#set) does not mention which operand is preferred when performing the usual binary operations. For example the following sample code doesn't have a defined result

[issue18750] '' % [1] doesn't fail

2013-08-19 Thread Giacomo Alzetta
Giacomo Alzetta added the comment: Note that the documentation for formatting with %, found here: http://docs.python.org/2/library/stdtypes.html#string-formatting-operations, states: If format requires a single argument, values may be a single non-tuple object. [5] Otherwise, values must

[issue16273] f.tell() returning negative number on Windows build

2013-04-11 Thread Giacomo Alzetta
Giacomo Alzetta added the comment: I can reproduce a similar behaviour, but instead of negative values I obtain huge values(which may as well be a negative unsigned converted to a python int). See this stackoverflow question: http://stackoverflow.com/questions/15934950/python-file-tell

[issue16273] f.tell() returning negative number on Windows build

2013-04-11 Thread Giacomo Alzetta
Giacomo Alzetta added the comment: The documentation for python 3.3.1 states, at http://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files, states: f.tell() returns an integer giving the file object’s current position in the file, **measured in bytes from the beginning

[issue16273] f.tell() returning negative number on Windows build

2013-04-10 Thread Giacomo Alzetta
Giacomo Alzetta added the comment: I can't find any mention of this behaviour in python3's documentation, nor any reference to ftell(). Is it only well hidden or was it deleted by accident? -- nosy: +bakuriu status: pending - open ___ Python tracker