Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:46:11+00:00 2026-06-14T00:46:11+00:00

First, a disclaimer: I’m not too familiar with YAML. I’m trying to parse a

  • 0

First, a disclaimer: I’m not too familiar with YAML. I’m trying to parse a YAML doc into Key Value Pairs (don’t worry about how I’m doing it. I’ve got that bit handled)

My file used to look something like:

world:
     people:
          name:Suzy
          address:chez-bob

Then, someone went and changed it.

world:
     people:
          name:!$uzy
          address:chez-bob

And I get this parse error:

yaml.constructor.ConstructorError: could not determine a constructor for the tag '!$uzy'

What does this even mean? How would I go about getting it to just interpret !$ as just two characters?
I just want a dictionary of string keys and values!
Also, editing the yaml files is not an option. Problem must be fixed in the code using the parser.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:46:13+00:00Added an answer on June 14, 2026 at 12:46 am

    Exclamation mark is a prefix for YAML tags. The parser has to implement a constructor for it by the tag name. There are some default tags like !!bool, !!int, etc. and even some Python specific tags like !!python/tuple.

    You can define your own constructors and even constructors for multiple tags caught by a prefix. By defining the prefix to '', you can catch all the tags and ignore them. You can return the tag and its value from the constructor to just treat it all as text.

    >>> import yaml
    >>> def default_ctor(loader, tag_suffix, node):
    ...     print loader
    ...     print tag_suffix
    ...     print node
    ...     return tag_suffix + ' ' + node.value
    ...
    >>> yaml.add_multi_constructor('', default_ctor)
    >>> yaml.load(y)
    <yaml.loader.Loader object at 0xb76ce8ec>
    !$uzy
    ScalarNode(tag=u'!$uzy', value=u'')
    {'world': {'people': {'name': '!$uzy', 'address': 'chez-bob'}}}
    >>>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first is the disclaimer, I did not design the database I am now supporting
Disclaimer: This is my first time writing unit tests...be gentle! :) I am trying
First, a disclaimer. I'm not a CS grad nor a math major, so simplicity
First off, I need to give a disclaimer: DO NOT RUN THIS JAVASCRIPT It
I am trying to have a disclaimer pop up when the app is first
First the disclaimer: I never learnt any programming in school, and just have to
In my application I first display to the user a disclaimer page as the
The Disclaimer First of all, I know this question (or close variations) have been
Disclaimer:It's my first time developing an app that will be on a tablet style
I am creating a Disclaimer that will be shown when the user first launches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.