TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #61 · 2 апр.

Ранее я уже упоминал о другой фишке из ˍˍfutureˍˍ , это оператор деления. from __future__ import division Суть проста. Раньше сложность типа данных результата поределялась типом самого сложного операнда. Например: int/int => int int/float => float В первом случае оба операнда int, значит и результат будет int. Во втором float более сложный тип, поэтому результат будет float. Если нам требуется получить дробное значение при делении двух int то приходилось форсированно один из операндов конверировать в float. 12/float(5) => float Но с новой "философией" это не требуется. В Python3 "floor division" заменили на "true division" а старый способ теперь работает через оператор "//". >>> 3/2 1.5 >>> 3//2 1 То есть теперь деление int на int даёт float если результат не целое число. В классах теперь доступны методы __floordiv__() и __truediv__() для определения поведения с этими операторами. Данный переход описан в PEP238. #pep#2to3#basic

Резултати

Пронајдени 2 слични објави

Пребарај: #libxml2

当前筛选 #libxml2清除筛选
AIGC

@aigcrubbish · Post #16 · 25.12.2024 г., 18:34

libxml2 在 2.11.9、2.12.9 和 2.13.3 之前的版本中存在一个安全漏洞,SAX 解析器在自定义 SAX 处理程序尝试通过设置 "checked" 来覆盖实体内容时,仍然会为外部实体生成事件。这使得经典的 XXE(XML 外部实体注入)攻击成为可能。 该漏洞已在后续版本中修复,建议用户尽快升级到最新版本以避免潜在的安全风险。 参考链接: - [GitHub 安全公告](https://github.com/advisories/GHSA-6c2p-rqx3-w4px) - [NVD 漏洞详情](https://nvd.nist.gov/vuln/detail/CVE-2024-40896) - [libxml2 修复提交](https://gitlab.gnome.org/GNOME/libxml2/-/commit/1a8932303969907f6572b1b6aac4081c56adb5c6) - [libxml2 问题报告](https://gitlab.gnome.org/GNOME/libxml2/-/issues/761) #安全漏洞#XXE#libxml2#SAX解析器 #AIGC

djangoproject

@djangoproject · Post #551 · 23.01.2018 г., 16:28

http://lxml.de/ #lxml is the most feature-rich and easy-to-use library for processing #XML and #HTML in the Python language. The lxml XML toolkit is a Pythonic binding for the #C libraries #libxml2 and #libxslt. It is unique in that it combines the speed and XML feature completeness of these libraries with the simplicity of a native Python #API, mostly compatible but superior to the well-known ElementTree API. The latest release works with all #CPython versions from 2.6 to 3.6. See the introduction for more information about background and goals of the lxml project. Some common questions are answered in the FAQ.