René's URL Explorer Experiment


Title: typedef only returns value if prefixed/imported type · Issue #153 · CESNET/libyang-python · GitHub

Open Graph Title: typedef only returns value if prefixed/imported type · Issue #153 · CESNET/libyang-python

X Title: typedef only returns value if prefixed/imported type · Issue #153 · CESNET/libyang-python

Description: Hi, I think there is an issue with the implement of the typedef function of the Type class. If seems to only assume a ":" will be present in the type, but from my understanding this will only be the case for type that are imported from a...

Open Graph Description: Hi, I think there is an issue with the implement of the typedef function of the Type class. If seems to only assume a ":" will be present in the type, but from my understanding this will only be th...

X Description: Hi, I think there is an issue with the implement of the typedef function of the Type class. If seems to only assume a ":" will be present in the type, but from my understanding this will ...

Opengraph URL: https://github.com/CESNET/libyang-python/issues/153

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"typedef only returns value if prefixed/imported type","articleBody":"Hi,\n\nI think there is an issue with the implement of the **typedef** function of the **Type** class.\n\nIf seems to only assume a \":\" will be present in the type, but from my understanding this will only be the case for type that are imported from another yang schema:\n\nhttps://github.com/CESNET/libyang-python/blob/3072af036386a6bb0fde285eba751e09a4948261/libyang/schema.py#L656-L662\n\nFor instance with this schema, my \"operation-status\" enumeration was not found properly.\n\n```yang\nmodule my_imported_module {\n    namespace \"urn:ietf:params:xml:ns:yang:my-imported-module\";\n    prefix \"my-imported-module\";\n\n    typedef operation-status {\n        type enumeration {\n            enum \"inactive\" {\n                description \"The operation is currently inactive and not running\";\n            }\n            enum \"active\" {\n                description \"The operation is currently active and running normally\";\n            }\n            enum \"pending\" {\n                description \"The operation is pending and waiting to be started\";\n            }\n            enum \"error\" {\n                description \"The operation has encountered an error and requires attention\";\n            }\n            enum \"maintenance\" {\n                description \"The operation is under maintenance and temporarily unavailable\";\n            }\n        }\n        description \"Enumeration representing the operational status of a service or component\";\n    }\n\n    grouping my-imported-container {\n        container my-imported-container {\n            leaf custom-leaf-config-true {\n                config true;\n                type string;\n            }\n            leaf custom-leaf-config-false {\n                config false;\n                type string;\n            }\n\n            leaf operation-status {\n                type operation-status;\n                description \"Requested operational status of this specific service instance in the container\";\n            }\n        }\n    }\n}\n\n```\n\n\nI had to do a \"double-pass\", with a search using the typedef first, then adding a search in the local module, like so:\n\n```python\n    def typedef(self) -\u003e YangTypedef:\n        external_typedef = self.type.typedef()\n        if external_typedef is not None:\n            return YangTypedef(external_typedef)\n\n        # There is a bug in default get_typedef: it only searches in external modules using a prefix\n        internal_typedef = self.type.module().get_typedef(self.type.name())\n        return YangTypedef(internal_typedef) if internal_typedef is not None else None\n```\n\nis my understanding correct ?","author":{"url":"https://github.com/Krisscut","@type":"Person","name":"Krisscut"},"datePublished":"2025-09-24T15:42:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/153/libyang-python/issues/153"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a7d8489e-4568-b1fd-e259-b9fe4a5b4c75
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCD36:24B4CE:12FD14B:1A2B370:6969FFB4
html-safe-nonce17d0c61441a41539ea65258dcda1438886e10e5e2851e29666f621af38d0a8b0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDM2OjI0QjRDRToxMkZEMTRCOjFBMkIzNzA6Njk2OUZGQjQiLCJ2aXNpdG9yX2lkIjoiNjc3OTE4NzI2MDkyNzExNTE4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac43a6216c30353b20bacd391d93e7e202b9aa633464acf879f095ad1472bbd99d
hovercard-subject-tagissue:3449982012
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/CESNET/libyang-python/153/issue_layout
twitter:imagehttps://opengraph.githubassets.com/81d21ab20da57c2f16e40ad8b904aebb9ca2ea65e9dbed48dceacf32e04c191b/CESNET/libyang-python/issues/153
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/81d21ab20da57c2f16e40ad8b904aebb9ca2ea65e9dbed48dceacf32e04c191b/CESNET/libyang-python/issues/153
og:image:altHi, I think there is an issue with the implement of the typedef function of the Type class. If seems to only assume a ":" will be present in the type, but from my understanding this will only be th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameKrisscut
hostnamegithub.com
expected-hostnamegithub.com
None7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8
turbo-cache-controlno-preview
go-importgithub.com/CESNET/libyang-python git https://github.com/CESNET/libyang-python.git
octolytics-dimension-user_id1116469
octolytics-dimension-user_loginCESNET
octolytics-dimension-repository_id275748507
octolytics-dimension-repository_nwoCESNET/libyang-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id275748507
octolytics-dimension-repository_network_root_nwoCESNET/libyang-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasebdde15ad1b403e23b08bbd89b53fbe6bdf688cad
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/CESNET/libyang-python/issues/153#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FCESNET%2Flibyang-python%2Fissues%2F153
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FCESNET%2Flibyang-python%2Fissues%2F153
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=CESNET%2Flibyang-python
Reloadhttps://github.com/CESNET/libyang-python/issues/153
Reloadhttps://github.com/CESNET/libyang-python/issues/153
Reloadhttps://github.com/CESNET/libyang-python/issues/153
CESNET https://github.com/CESNET
libyang-pythonhttps://github.com/CESNET/libyang-python
Notifications https://github.com/login?return_to=%2FCESNET%2Flibyang-python
Fork 53 https://github.com/login?return_to=%2FCESNET%2Flibyang-python
Star 67 https://github.com/login?return_to=%2FCESNET%2Flibyang-python
Code https://github.com/CESNET/libyang-python
Issues 15 https://github.com/CESNET/libyang-python/issues
Pull requests 2 https://github.com/CESNET/libyang-python/pulls
Actions https://github.com/CESNET/libyang-python/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/CESNET/libyang-python/security
Please reload this pagehttps://github.com/CESNET/libyang-python/issues/153
Insights https://github.com/CESNET/libyang-python/pulse
Code https://github.com/CESNET/libyang-python
Issues https://github.com/CESNET/libyang-python/issues
Pull requests https://github.com/CESNET/libyang-python/pulls
Actions https://github.com/CESNET/libyang-python/actions
Security https://github.com/CESNET/libyang-python/security
Insights https://github.com/CESNET/libyang-python/pulse
New issuehttps://github.com/login?return_to=https://github.com/CESNET/libyang-python/issues/153
New issuehttps://github.com/login?return_to=https://github.com/CESNET/libyang-python/issues/153
typedef only returns value if prefixed/imported typehttps://github.com/CESNET/libyang-python/issues/153#top
https://github.com/Krisscut
https://github.com/Krisscut
Krisscuthttps://github.com/Krisscut
on Sep 24, 2025https://github.com/CESNET/libyang-python/issues/153#issue-3449982012
libyang-python/libyang/schema.pyhttps://github.com/CESNET/libyang-python/blob/3072af036386a6bb0fde285eba751e09a4948261/libyang/schema.py#L656-L662
3072af0https://github.com/CESNET/libyang-python/commit/3072af036386a6bb0fde285eba751e09a4948261
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.