https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
DeinAlptraum wrote:
CI is done, so could you merge this? Thanks for the reviews and support
@Endilll!
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listin
https://github.com/Endilll approved this pull request.
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DeinAlptraum updated
https://github.com/llvm/llvm-project/pull/95608
>From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001
From: Jannick Kremer
Date: Fri, 14 Jun 2024 22:12:09 +0100
Subject: [PATCH 1/6] [libclang/python] Refactor enum usage
Use Python's bui
@@ -142,6 +142,7 @@ Clang Python Bindings Potentially Breaking Changes
of variant 271.
- Renamed ``TypeKind`` variant 162 from ``OBJCCLASS`` to ``OBJCTYPEPARAM``.
The previous name was incorrect, it was a duplicate of variant 28.
+- Refactored enum usage, switching to the s
DeinAlptraum wrote:
I added a release note to the `Clang Python Bindings Potentially Breaking
Changes` section
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailm
https://github.com/DeinAlptraum updated
https://github.com/llvm/llvm-project/pull/95608
>From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001
From: Jannick Kremer
Date: Fri, 14 Jun 2024 22:12:09 +0100
Subject: [PATCH 1/5] [libclang/python] Refactor enum usage
Use Python's bui
Endilll wrote:
The refactoring itself is worth mentioning in potentially breaking changes,
because this covers a significant surface of our Python API.
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm
DeinAlptraum wrote:
Hmm what do you think should be mentioned in a release note @Endilll ?
Since this is just refactoring, if I did everything correctly, users of the
bindings should not notice any difference (except for different error
messages). So just mention refactoring of enums in the bin
Endilll wrote:
@DeinAlptraum This is also worth a release note, I think.
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Endilll wrote:
> @Endilll do you think this can be merged now?
After CI passes.
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -611,51 +612,25 @@ def register(value, name):
### Cursor Kinds ###
-class BaseEnumeration:
+class BaseEnumeration(Enum):
"""
Common base class for named enumerations held in sync with Index.h values.
-
-Subclasses must define their own _kinds and _name_map me
https://github.com/DeinAlptraum updated
https://github.com/llvm/llvm-project/pull/95608
>From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001
From: Jannick Kremer
Date: Fri, 14 Jun 2024 22:12:09 +0100
Subject: [PATCH 1/4] [libclang/python] Refactor enum usage
Use Python's bui
@@ -611,51 +612,25 @@ def register(value, name):
### Cursor Kinds ###
-class BaseEnumeration:
+class BaseEnumeration(Enum):
"""
Common base class for named enumerations held in sync with Index.h values.
-
-Subclasses must define their own _kinds and _name_map me
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll commented:
Sorry for not getting back to you earlier.
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
DeinAlptraum wrote:
*Ping\*
@Endilll how should we proceed with this?
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
DeinAlptraum wrote:
@Endilll do you think this needs a second review?
If not, could you merge this? Since I don't have commit access
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.l
https://github.com/DeinAlptraum edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DeinAlptraum edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -10,26 +10,6 @@
class TestTokenKind(unittest.TestCase):
-def test_constructor(self):
DeinAlptraum wrote:
So the existing "custom" enum implementation included a sort of constructor, as
we see in this test, that takes a number and name and then adds t
https://github.com/DeinAlptraum updated
https://github.com/llvm/llvm-project/pull/95608
>From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001
From: Jannick Kremer
Date: Fri, 14 Jun 2024 22:12:09 +0100
Subject: [PATCH 1/3] [libclang/python] Refactor enum usage
Use Python's bui
@@ -10,26 +10,6 @@
class TestTokenKind(unittest.TestCase):
-def test_constructor(self):
Endilll wrote:
> test_constructor: this tests the ability to add enum variants "on the fly",
> which is not possible with the Python stdlib's Enum class
Do we have
https://github.com/DeinAlptraum edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DeinAlptraum edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -10,26 +10,6 @@
class TestTokenKind(unittest.TestCase):
-def test_constructor(self):
DeinAlptraum wrote:
thNot really:
- `test_constructor`: this tests the ability to add enum variants "on the fly",
which is not possible with the Python stdlib's `Enu
@@ -10,26 +10,6 @@
class TestTokenKind(unittest.TestCase):
-def test_constructor(self):
Endilll wrote:
Can't we keep those tests?
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cf
DeinAlptraum wrote:
\*Ping*
@boomanaiden154 @linux4life798 a review/feedback would be appreciated!
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/
https://github.com/DeinAlptraum edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Endilll wrote:
Also worth pinging @linux4life798
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
DeinAlptraum wrote:
@Endilll done with the TokenKind refactoring, so this is ready to go from my
side.
Regarding reviewers, can you recommend any others? Since I assume I'll open a
couple more PRs for the Python bindings after this
https://github.com/llvm/llvm-project/pull/95608
_
https://github.com/DeinAlptraum updated
https://github.com/llvm/llvm-project/pull/95608
>From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001
From: Jannick Kremer
Date: Fri, 14 Jun 2024 22:12:09 +0100
Subject: [PATCH 1/2] [libclang/python] Refactor enum usage
Use Python's bui
github-actions[bot] wrote:
:warning: Python code formatter, darker found issues in your code. :warning:
You can test this locally with the following command:
``bash
darker --check --diff -r
cc7a18c18011d1e0c70187ceb60e3e69bf7cd0ee...82f120f207a4a9425cdbccafdba8974bc00ffc51
clang
https://github.com/DeinAlptraum updated
https://github.com/llvm/llvm-project/pull/95608
>From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001
From: Jannick Kremer
Date: Fri, 14 Jun 2024 22:12:09 +0100
Subject: [PATCH 1/2] [libclang/python] Refactor enum usage
Use Python's bui
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Endilll wrote:
> @Endilll are you taking a look at this, and/or should I ask other reviewers?
It's never a bad idea to add more reviewers, as long as they are relevant.
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-c
https://github.com/Endilll commented:
LGTM
> There is also TokenKind: this one does not currently inherit from
> BaseEnumeration and is defined somewhat differently, having all its variants
> and their IDs as a dictionary in enumerations.py. This seems quite arbitrary
> to me, is there any re
DeinAlptraum wrote:
@Endilll are you taking a look at this, and/or should I ask other reviewers?
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
https://github.com/DeinAlptraum edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
DeinAlptraum wrote:
@Endilll can I ask you for a review again?
As a next step towards the python-bindings strict typing PR, this one captures
all the enum refactoring changes necessary towards that goal. Don't be scared
by the LoC changed: 90% of that is just indentation changes :)
https://git
@@ -611,51 +612,25 @@ def register(value, name):
### Cursor Kinds ###
-class BaseEnumeration:
+class BaseEnumeration(Enum):
"""
Common base class for named enumerations held in sync with Index.h values.
-
-Subclasses must define their own _kinds and _name_map me
@@ -611,51 +612,25 @@ def register(value, name):
### Cursor Kinds ###
-class BaseEnumeration:
+class BaseEnumeration(Enum):
"""
Common base class for named enumerations held in sync with Index.h values.
-
-Subclasses must define their own _kinds and _name_map me
@@ -31,17 +31,9 @@ class TestCursorKind(unittest.TestCase):
def test_from_id(self):
"""Check that kinds can be constructed from valid IDs"""
for enum in self.enums:
-self.assertEqual(enum.from_id(2), enum._kinds[2])
+self.assertEqual(
https://github.com/DeinAlptraum commented:
There is also `TokenKind`: this one does not currently inherit from
`BaseEnumeration` and is defined somewhat differently, having all its variants
and their IDs as a dictionary in `enumerations.py`. This seems quite arbitrary
to me, is there any reaso
https://github.com/DeinAlptraum edited
https://github.com/llvm/llvm-project/pull/95608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -611,51 +612,25 @@ def register(value, name):
### Cursor Kinds ###
-class BaseEnumeration:
+class BaseEnumeration(Enum):
"""
Common base class for named enumerations held in sync with Index.h values.
-
-Subclasses must define their own _kinds and _name_map me
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Jannick Kremer (DeinAlptraum)
Changes
Use Python's builtin enum class instead of writing our own.
This is preparation for passing a strict type check in PR #78114 ,
fixing 920 out of 1341 strict typing errors
---
Patch is 64.63 KiB, tru
https://github.com/DeinAlptraum created
https://github.com/llvm/llvm-project/pull/95608
Use Python's builtin enum class instead of writing our own.
This is preparation for passing a strict type check in PR #78114 , fixing 920
out of 1341 strict typing errors
>From 35bfcfbc69ee812c59350440b7b1
48 matches
Mail list logo