Type4Py: Deep Similarity Learning-Based Type Inference for #python
Over the past decade, machine learning (ML) has been applied successfully to a variety of tasks such as computer vision and natural language processing. Motivated by this, in recent years, researchers have employed ML techniques to solve code-related problems, including but not limited to, code completion, code generation, program repair, and type inference.
Dynamic programming languages like Python and TypeScript allows developers to optionally define type annotations and benefit from the advantages of static typing such as better code completion, early bug detection, and etc. However, retrofitting types is a cumbersome and error-prone process. To address this, we propose Type4Py, an ML-based type auto-completion for Python. It assists developers to gradually add type annotations to their codebases.
https://github.com/saltudelft/type4py
Announcing post: https://mirblog.net/index.php/2021/07/31/development-and-release-of-type4py-machine-learning-based-type-auto-completion-for-python/
Over the past decade, machine learning (ML) has been applied successfully to a variety of tasks such as computer vision and natural language processing. Motivated by this, in recent years, researchers have employed ML techniques to solve code-related problems, including but not limited to, code completion, code generation, program repair, and type inference.
Dynamic programming languages like Python and TypeScript allows developers to optionally define type annotations and benefit from the advantages of static typing such as better code completion, early bug detection, and etc. However, retrofitting types is a cumbersome and error-prone process. To address this, we propose Type4Py, an ML-based type auto-completion for Python. It assists developers to gradually add type annotations to their codebases.
https://github.com/saltudelft/type4py
Announcing post: https://mirblog.net/index.php/2021/07/31/development-and-release-of-type4py-machine-learning-based-type-auto-completion-for-python/
Paranoid Scientist is a #python module for verifying scientific software.
It provides:
- Runtime verification of entry and exit conditions written in pure Python, including hyperproperties.
- Conditions specified using pure Python refinement types, i.e. types are defined by predicates.
- Automated unit testing of individual functions.
It is inspired by contract-oriented programming, type classes, static type checking, and fuzz testing.
Paranoid Scientist is a tool to make sure scientific code is correct. Verification is extremely important for scientific software because, unlike most software, we don’t know what the output will be until we run the program. In fact, the program is written in order to examine the output. However, we have no robust way of knowing whether the output is due to a software bug. For example, code performing a complex statistical test could normalize the wrong column, an error which would likely go undetected.
Paranoid Scientist attempts to remedy this situation by providing some key tools from the software verification community to the scientific community. Traditional program verification asks the question, “If I run my code, will it run correctly?” In practice, this is time consuming and requires highly specialized training. For scientific programming, it is acceptable to instead ask, “If I already ran my code, did it run correctly?” In other words, it is not as important to know before executing the program whether it will run correctly. Paranoid Scientist is already in use in scientific software.
https://github.com/mwshinn/paranoidscientist
It provides:
- Runtime verification of entry and exit conditions written in pure Python, including hyperproperties.
- Conditions specified using pure Python refinement types, i.e. types are defined by predicates.
- Automated unit testing of individual functions.
It is inspired by contract-oriented programming, type classes, static type checking, and fuzz testing.
Paranoid Scientist is a tool to make sure scientific code is correct. Verification is extremely important for scientific software because, unlike most software, we don’t know what the output will be until we run the program. In fact, the program is written in order to examine the output. However, we have no robust way of knowing whether the output is due to a software bug. For example, code performing a complex statistical test could normalize the wrong column, an error which would likely go undetected.
Paranoid Scientist attempts to remedy this situation by providing some key tools from the software verification community to the scientific community. Traditional program verification asks the question, “If I run my code, will it run correctly?” In practice, this is time consuming and requires highly specialized training. For scientific programming, it is acceptable to instead ask, “If I already ran my code, did it run correctly?” In other words, it is not as important to know before executing the program whether it will run correctly. Paranoid Scientist is already in use in scientific software.
https://github.com/mwshinn/paranoidscientist
GitHub
GitHub - mwshinn/paranoidscientist: Runtime software verification and automated testing for scientific software in Python
Runtime software verification and automated testing for scientific software in Python - mwshinn/paranoidscientist
KDL is a document language with xml-like semantics that looks like you're invoking a bunch of CLI commands! It's meant to be used both as a serialization format and a configuration language, much like JSON, YAML, or XML.
Features:
- Node-based, you won't have to mess with identation to make it work
- Type annotations
- Implementations in different languages: #python, #elixir, #rust, #java, #js, #ruby, #php, etc
https://kdl.dev/
Features:
- Node-based, you won't have to mess with identation to make it work
- Type annotations
- Implementations in different languages: #python, #elixir, #rust, #java, #js, #ruby, #php, etc
https://kdl.dev/
CLI tool and python library that converts the output of popular command-line tools and file-types to JSON or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.
https://github.com/kellyjonbrazil/jc
#python
https://github.com/kellyjonbrazil/jc
#python
GitHub
GitHub - kellyjonbrazil/jc: CLI tool and python library that converts the output of popular command-line tools, file-types, and…
CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and ...
Interactive Redis: A Terminal Client for Redis with AutoCompletion and Syntax Highlighting.
IRedis is a terminal client for redis with auto-completion and syntax highlighting. IRedis lets you type Redis commands smoothly, and displays results in a user-friendly format.
IRedis is an alternative for redis-cli. In most cases, IRedis behaves exactly the same as redis-cli. Besides, it is safer to use IRedis on production servers than redis-cli: IRedis will prevent accidentally running dangerous commands, like
Has many other awesome features!
https://github.com/laixintao/iredis
#python
IRedis is a terminal client for redis with auto-completion and syntax highlighting. IRedis lets you type Redis commands smoothly, and displays results in a user-friendly format.
IRedis is an alternative for redis-cli. In most cases, IRedis behaves exactly the same as redis-cli. Besides, it is safer to use IRedis on production servers than redis-cli: IRedis will prevent accidentally running dangerous commands, like
KEYS *Has many other awesome features!
https://github.com/laixintao/iredis
#python
⚡️ Breaking news!
Python3.10 was released several hours ago (not so breaking news, right?). One of the main new features is pattern matching.
Today, I am releasing
Cool, isn't it? Today Python made one more giant step for better functional programming support. And no doubt, that
Check out our:
- Docs: https://returns.readthedocs.io/en/latest/pages/result.html#pattern-matching
- Release notes: https://github.com/dry-python/returns/releases/tag/0.17.0
- Python3.10 release notes: https://docs.python.org/3.10/whatsnew/3.10.html
Soon we will be adding pattern matching support for mypy as well. So, it would be type checked correctly.
Big day for #python!
Python3.10 was released several hours ago (not so breaking news, right?). One of the main new features is pattern matching.
Today, I am releasing
dry-python/returns@0.17.0 with full pattern matching support. Here's an example of how you can use it together with Result type:from returns.result import Failure, Success, safe
@safe
def div(first_number: int, second_number: int) -> int:
return first_number // second_number
match div(1, 0):
# Matches if the result stored inside `Success` is `10`
case Success(10):
print('Result is "10"')
# Matches any `Success` instance and binds its value to the `value` variable
case Success(value):
print('Result is "{0}"'.format(value))
# Matches if the result stored inside `Failure` is `ZeroDivisionError`
case Failure(ZeroDivisionError):
print('"ZeroDivisionError" was raised')
# Matches any `Failure` instance
case Failure(_):
print('The division was a failure')
Cool, isn't it? Today Python made one more giant step for better functional programming support. And no doubt, that
dry-python is the first one to officially support it.Check out our:
- Docs: https://returns.readthedocs.io/en/latest/pages/result.html#pattern-matching
- Release notes: https://github.com/dry-python/returns/releases/tag/0.17.0
- Python3.10 release notes: https://docs.python.org/3.10/whatsnew/3.10.html
Soon we will be adding pattern matching support for mypy as well. So, it would be type checked correctly.
Big day for #python!
SQLFluff is a dialect-flexible and configurable SQL linter. Designed with ELT applications in mind, SQLFluff also works with Jinja templating and dbt. SQLFluff will auto-fix most linting errors, allowing you to focus your time on what matters.
Although SQL is reasonably consistent in its implementations, there are several different dialects available with variations of syntax and grammar. SQLFluff currently supports the following SQL dialects (though perhaps not in full):
- ANSI SQL - this is the base version and on occasion may not strictly follow the ANSI/ISO SQL definition
- BigQuery
- Exasol
- Hive
- MySQL
- PostgreSQL (aka Postgres)
- Snowflake
- SQLite
- Teradata
- Transact-SQL (aka T-SQL)
https://github.com/sqlfluff/sqlfluff
#python
Although SQL is reasonably consistent in its implementations, there are several different dialects available with variations of syntax and grammar. SQLFluff currently supports the following SQL dialects (though perhaps not in full):
- ANSI SQL - this is the base version and on occasion may not strictly follow the ANSI/ISO SQL definition
- BigQuery
- Exasol
- Hive
- MySQL
- PostgreSQL (aka Postgres)
- Snowflake
- SQLite
- Teradata
- Transact-SQL (aka T-SQL)
https://github.com/sqlfluff/sqlfluff
#python
Сегодня говорим про
Вышел восьмой урок "Лучшего курса по Питону": https://www.youtube.com/watch?v=RbznhbK3vC0
Что вообще такое "Лучший курс по Питону"?
- Я решил разобрать все исходники CPython и показать, как на самом деле работают все его части
- В каждом видео я рассказываю про одну узкую тему
- Каждое видео я делю на три уровня сложности: для джунов, мидлов и сениоров
- Переодически беру интервью у других core-разработчиков CPython про разные части интерпретатора в их зоне интересов
- Получается очень хардкорно!
Например, в
Как устроен
Дополнительные материалы (не вошли в выпуск):
- mypy: bytes и bytearray c
- Мутабельность
-
-
Поддержать проект можно тут: https://boosty.to/sobolevn
#лкпп #python #c
bytes!Вышел восьмой урок "Лучшего курса по Питону": https://www.youtube.com/watch?v=RbznhbK3vC0
Что вообще такое "Лучший курс по Питону"?
- Я решил разобрать все исходники CPython и показать, как на самом деле работают все его части
- В каждом видео я рассказываю про одну узкую тему
- Каждое видео я делю на три уровня сложности: для джунов, мидлов и сениоров
- Переодически беру интервью у других core-разработчиков CPython про разные части интерпретатора в их зоне интересов
- Получается очень хардкорно!
Например, в
bytes я показываю, как устроен PyBytesObject (он простой):
typedef struct {
PyObject_VAR_HEAD
Py_DEPRECATED(3.11) Py_hash_t ob_shash;
char ob_sval[1];
/* Invariants:
* ob_sval contains space for 'ob_size+1' elements.
* ob_sval[ob_size] == 0.
* ob_shash is the hash of the byte string or -1 if not computed yet.
*/
} PyBytesObject;
Как устроен
Buffer протокол для bytes с его __buffer__ и __release_buffer__:
static int
bytes_buffer_getbuffer(PyBytesObject *self, Py_buffer *view, int flags)
{
return PyBuffer_FillInfo(view, (PyObject*)self, (void *)self->ob_sval, Py_SIZE(self), 1, flags);
}
static PyBufferProcs bytes_as_buffer = {
(getbufferproc)bytes_buffer_getbuffer,
NULL,
};
Дополнительные материалы (не вошли в выпуск):
- mypy: bytes и bytearray c
disable_bytearray_promotion и disable_memoryview_promotion https://github.com/python/mypy/commit/2d70ac0b33b448d5ef51c0856571068dd0754af6- Мутабельность
bytes https://docs.python.org/3.13/c-api/bytes.html#c._PyBytes_Resize-
PyBytes_Writer API: https://github.com/capi-workgroup/decisions/issues/39-
ob_shash deprecation: https://github.com/python/cpython/issues/91020Поддержать проект можно тут: https://boosty.to/sobolevn
#лкпп #python #c
YouTube
Лучший курс по Python 8: bytes
Лучший курс по питону: 8
Или "обзор исходников CPython с CPython core разработчиком".
Тема: bytes
- Магические методы bytes: __bytes__, __buffer__, __release_buffer__
- Способы записи bytes
- bytes и collections.abc: Sequence, Buffer, bytes_iterator
- bytes…
Или "обзор исходников CPython с CPython core разработчиком".
Тема: bytes
- Магические методы bytes: __bytes__, __buffer__, __release_buffer__
- Способы записи bytes
- bytes и collections.abc: Sequence, Buffer, bytes_iterator
- bytes…
🔥51❤15👍1👏1
PythoNN: видео с апрельского митапа
4 апреля прошел очередной #python митап в Нижнем Новгороде.
Было очень душевно и интересно.
Случился аншлаг! Пришло много нижегородцев и приехало очень много гостей: из Москвы, Питера, Кирова и других городов. Спасибо всем!
Было 4 крутых доклада:
- "Are you NATS?" – Гурбанов Михаил https://youtube.com/watch?v=atD3JVWurno
- "Почему исправление опечаток сложнее, чем кажется, и как мы с этим српавляемся" – Дмитрий Бровкин https://youtube.com/watch?v=9HRBwwaMIfA
- "Современный web с современными темплейтами" – Алексей Гончарук https://youtube.com/watch?v=lN3Pz_hUCio
- "Демистификация PostgreSQL-индексов" – Алексей Голобурдин https://youtube.com/watch?v=6kVGSLdj28k
А потом мы сидели в баре до 5 утра.
Что улучшить?
- Первый раз записывал на StreamYard, сделал плохую композицию слайдов и видео докладчика, исправим в следующий раз. Прикрепил все слайды в описании докладов – чтобы была возможность все прочитать и скопировать код
- Поработаем над звуком, сейчас он немного прыгал
Хотите присоединиться?
- Если хотите сделать доклад, пишите мне в личку – лично учу новичков выступать и делать слайды, полная свобода в выборе темы
- Если хотите просто послушать – следите за анонсами в чате и подписывайтесь на мой канал с записями
У нас в Нижнем – просто офигенно, всех ждем в гости! 🌆
| Поддержать | YouTube | GitHub | Чат |
4 апреля прошел очередной #python митап в Нижнем Новгороде.
Было очень душевно и интересно.
Случился аншлаг! Пришло много нижегородцев и приехало очень много гостей: из Москвы, Питера, Кирова и других городов. Спасибо всем!
Было 4 крутых доклада:
- "Are you NATS?" – Гурбанов Михаил https://youtube.com/watch?v=atD3JVWurno
- "Почему исправление опечаток сложнее, чем кажется, и как мы с этим српавляемся" – Дмитрий Бровкин https://youtube.com/watch?v=9HRBwwaMIfA
- "Современный web с современными темплейтами" – Алексей Гончарук https://youtube.com/watch?v=lN3Pz_hUCio
- "Демистификация PostgreSQL-индексов" – Алексей Голобурдин https://youtube.com/watch?v=6kVGSLdj28k
А потом мы сидели в баре до 5 утра.
Что улучшить?
- Первый раз записывал на StreamYard, сделал плохую композицию слайдов и видео докладчика, исправим в следующий раз. Прикрепил все слайды в описании докладов – чтобы была возможность все прочитать и скопировать код
- Поработаем над звуком, сейчас он немного прыгал
Хотите присоединиться?
- Если хотите сделать доклад, пишите мне в личку – лично учу новичков выступать и делать слайды, полная свобода в выборе темы
- Если хотите просто послушать – следите за анонсами в чате и подписывайтесь на мой канал с записями
У нас в Нижнем – просто офигенно, всех ждем в гости! 🌆
| Поддержать | YouTube | GitHub | Чат |
9🔥71👍29❤5👏1😁1🤩1
Находки в опенсорсе: EasyP – тулбокс для ProtoBuf файлов
https://www.youtube.com/watch?v=XI-dNpM77iM
Хоть
Если много используете ProtoBuf – обязательно для ознакомления!
Как оно работает?
Прощайте огромные
Что будет в видео?
В видео:
- спросим зачем ребята его сделали
- узнаем как оно работает
- покажем, откуда можно устанавливать зависимости
- потыкаем разные юзкейсы
- поговорим про безопасность решения
- обсудим планы на следующие релизы
- расскажем как находить ломающие изменения в вашей ProtoBuf спецификации
А еще в видео кот на гитаре играет!
Репозиторий: https://github.com/easyp-tech/easyp
Документация: https://easyp.tech
Чатик сообщества: @easyptech
Поставьте пацанам звездочек, если проект понравился!
Обсуждение: Какие инструменты для ProtoBuf вы используете? Какие есть пролемы? Что можно было бы добавить в качестве новой фичи в easyp?
| Поддержать | YouTube | GitHub | Чат |
https://www.youtube.com/watch?v=XI-dNpM77iM
easyp – пакетный менеджер, билд-система и линтер для .proto файлов.Хоть
easyp и написан на #go 😱, одна из его фишек в том – что вы можете использовать любые плагины для генерации финального кода: он может быть хоть на #python, хоть на #rust.Если много используете ProtoBuf – обязательно для ознакомления!
Как оно работает?
# Секция для правил линтера:
lint:
use:
- DEFAULT
# Секция с зависимостями:
deps:
- github.com/googleapis/googleapis
- github.com/grpc-ecosystem/grpc-gateway@v2.20.0
# Секция для правил сборки и генерации итоговых файлов:
generate:
plugins:
- name: go
out: .
opts:
paths: source_relative
- name: go-grpc
out: .
opts:
paths: source_relative
require_unimplemented_servers: false
Прощайте огромные
Makefile с кучей скриптов для сборки.Что будет в видео?
В видео:
- спросим зачем ребята его сделали
- узнаем как оно работает
- покажем, откуда можно устанавливать зависимости
- потыкаем разные юзкейсы
- поговорим про безопасность решения
- обсудим планы на следующие релизы
- расскажем как находить ломающие изменения в вашей ProtoBuf спецификации
А еще в видео кот на гитаре играет!
Репозиторий: https://github.com/easyp-tech/easyp
Документация: https://easyp.tech
Чатик сообщества: @easyptech
Поставьте пацанам звездочек, если проект понравился!
Обсуждение: Какие инструменты для ProtoBuf вы используете? Какие есть пролемы? Что можно было бы добавить в качестве новой фичи в easyp?
| Поддержать | YouTube | GitHub | Чат |
YouTube
Находки в опенсорсе: EasyP – тулбокс для работы с ProtoBuf
- Мой телеграм канал: https://xn--r1a.website/opensource_findings
- Наш чат, где можно обсудить выпуск: https://xn--r1a.website/opensource_findings_chat
- Поддержать: https://boosty.to/sobolevn
- Мой GitHub: https://github.com/sobolevn
EasyP – тулбокс для работы с ProtoBuf файлами.…
- Наш чат, где можно обсудить выпуск: https://xn--r1a.website/opensource_findings_chat
- Поддержать: https://boosty.to/sobolevn
- Мой GitHub: https://github.com/sobolevn
EasyP – тулбокс для работы с ProtoBuf файлами.…
22❤28👍22🔥11🤯3