Michael Carlstrom
cf020a1de2
feat(types) Allow setting types for attributes (#5460)
* init
* add comment
* style: pre-commit fixes
* fix extra ;
* Add annotation helper for older python versions
* style: pre-commit fixes
* test writing __annotations__ to __dict__
* style: pre-commit fixes
* revert bac to __annotations__
* use getattr for automatic init
* use std::move
* update helper
* remove stdmove
* test isinstance
* style: pre-commit fixes
* add #if 3.9
* style: pre-commit fixes
* use getattr
* add dir
* use hasattr
* try setattr
* add c++17 guard
* style: pre-commit fixes
* add compile guard
* style: pre-commit fixes
* cleanup
* comments and function name cleanup
* style: pre-commit fixes
* update test case
* style: pre-commit fixes
* add write
* added instance check
* style: pre-commit fixes
* Test for `__cpp_inline_variables` and use `static_assert()`
* Add guard: __annotations__["list_int"] was set already.
* Avoid explicit `false` in `static_assert()`.
* add redeclaration test
* style: pre-commit fixes
* add handle support to attr_with_type_hint
* store reintpreted_key
* style: pre-commit fixes
* fix str namespace
* fix scope?
* string wrap
* clang tidy
* Swap order of attr_with_type_hint implementation in cast.h (so that the `const char *` overload appears first).
* Reuse `const char *` overload from `handle` overload.
* Added comment
* style: pre-commit fixes
* line up comment
* fixed spelling error
* Add missing period
* Introduce `detail::always_false<>` to make the new `static_assert()` more readable.
* Copy `attr` comment for `const char *` overload, for consistency.
* static_assert(std::false_type::value, ...)
* Revert "static_assert(std::false_type::value, ...)"
This reverts commit 999b668688b5b965a6f929a5a7f8af5176c8a21d.
* Add comment for `always_false`
* add test for inspect.get_annotations()
* style: pre-commit fixes
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
2024-12-21 16:22:08 -08:00
..
2024-11-10 12:17:35 -08:00
2024-06-22 00:55:00 -04:00
2024-10-07 14:12:04 -07:00
2024-10-07 14:12:04 -07:00
2024-12-08 11:30:49 -08:00
2024-11-11 15:35:28 -08:00
2024-11-18 14:39:59 -08:00
2024-06-18 13:54:38 -07:00
2024-06-18 13:54:38 -07:00
2024-09-17 09:47:20 -07:00
2024-06-18 13:54:38 -07:00
2024-10-07 14:12:04 -07:00
2024-11-10 12:17:35 -08:00
2024-09-13 00:18:29 -04:00
2024-09-13 00:18:29 -04:00
2024-08-22 00:27:50 -04:00
2022-02-10 12:17:07 -08:00
2024-06-18 13:54:38 -07:00
2024-11-07 09:32:09 -08:00
2024-11-07 09:32:09 -08:00
2024-08-14 18:21:04 -04:00
2024-05-24 12:26:40 -04:00
2024-10-07 14:12:04 -07:00
2022-02-10 12:17:07 -08:00
2024-09-03 10:51:21 -04:00
2024-11-05 10:14:24 -08:00
2024-11-05 10:14:24 -08:00
2024-04-02 11:14:08 -04:00
2024-07-30 09:18:35 -07:00
2024-10-07 14:12:04 -07:00
2024-10-25 08:28:15 -07:00
2024-10-07 14:12:04 -07:00
2024-10-07 14:12:04 -07:00
2022-02-10 12:17:07 -08:00
2024-06-22 00:55:00 -04:00
2024-10-12 11:19:50 -07:00
2024-11-07 09:32:09 -08:00
2022-02-14 11:36:22 -08:00
2024-06-22 00:55:00 -04:00
2024-03-26 13:57:05 -04:00
2024-06-22 00:55:00 -04:00
2024-06-24 08:59:55 -07:00
2024-10-25 08:28:15 -07:00
2024-09-13 00:18:29 -04:00
2024-09-13 00:18:29 -04:00
2024-09-13 00:18:29 -04:00
2024-10-07 14:12:04 -07:00
2024-04-02 11:14:08 -04:00
2024-10-25 08:28:15 -07:00
2021-09-24 12:08:22 -07:00
2024-10-07 14:12:04 -07:00
2024-12-08 11:30:49 -08:00
2024-12-08 11:30:49 -08:00
2024-04-02 11:14:08 -04:00
2024-06-22 00:55:00 -04:00
2024-08-22 00:27:50 -04:00
2024-10-25 08:28:15 -07:00
2022-12-20 05:34:00 -08:00
2024-07-29 11:10:03 -07:00
2024-10-07 14:12:04 -07:00
2022-02-10 12:17:07 -08:00
2024-11-11 15:35:28 -08:00
2024-06-22 00:55:00 -04:00
2022-02-10 12:17:07 -08:00
2024-10-07 14:12:04 -07:00
2024-09-17 09:47:20 -07:00
2023-08-07 20:48:20 -07:00
2024-10-11 20:36:41 -07:00
2022-02-14 11:36:22 -08:00
2024-10-07 14:12:04 -07:00
2022-10-30 08:57:23 -07:00
2024-10-07 14:12:04 -07:00
2022-02-14 11:36:22 -08:00
2024-11-18 14:39:59 -08:00
2024-11-11 14:51:01 -08:00
2024-11-11 14:51:01 -08:00
2022-02-10 12:17:07 -08:00
2024-06-22 00:55:00 -04:00
2024-11-11 15:35:28 -08:00
2024-11-11 15:35:28 -08:00
2024-07-29 11:10:03 -07:00
2024-10-07 14:12:04 -07:00
2022-02-10 12:17:07 -08:00
2024-10-07 14:12:04 -07:00
2024-11-16 13:45:59 -08:00
2024-11-16 13:45:59 -08:00
2024-11-17 07:56:02 -08:00
2024-11-17 07:56:02 -08:00
2022-05-26 11:07:40 -04:00
2024-06-22 00:55:00 -04:00
2024-08-22 00:27:50 -04:00
2024-10-25 08:28:15 -07:00
2022-11-28 07:39:38 -08:00
2024-10-25 08:28:15 -07:00
2022-05-02 12:39:36 -07:00
2024-11-11 15:35:28 -08:00
2023-11-08 12:44:04 -08:00
2024-06-22 00:55:00 -04:00
2024-12-21 16:22:08 -08:00
2024-12-21 16:22:08 -08:00
2024-08-22 00:27:50 -04:00
2024-11-11 15:35:28 -08:00
2024-08-22 00:27:50 -04:00
2024-10-07 14:12:04 -07:00
2024-04-02 11:14:08 -04:00
2024-10-08 10:49:35 -07:00
2024-12-08 11:30:49 -08:00
2024-12-08 11:30:49 -08:00
2024-08-22 00:27:50 -04:00
2024-06-22 00:55:00 -04:00
2024-05-10 17:03:51 -04:00
2024-07-18 14:50:38 -04:00
2024-10-07 14:12:04 -07:00
2024-06-22 00:55:00 -04:00
2024-08-09 13:28:12 -07:00
2024-08-09 13:28:12 -07:00
2019-06-11 23:28:58 +02:00
2024-06-22 00:55:00 -04:00
2023-04-25 14:03:24 -07:00
2024-06-22 00:55:00 -04:00
2023-04-25 14:03:24 -07:00
2024-06-22 00:55:00 -04:00
2023-04-27 07:24:48 -07:00
2024-06-22 00:55:00 -04:00
2024-08-22 00:27:50 -04:00
2024-10-07 14:12:04 -07:00
2024-08-28 20:55:50 -07:00
2024-08-28 20:55:50 -07:00
2021-07-04 19:58:35 -04:00
2021-01-31 17:29:09 -05:00