Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use of six.text type for comparison in treewalker._base #63

Closed
Labels
Milestone
@marcdm

Description

@marcdm

all over the in the file html5lib/treewalkers/_base.py there are places where isinstance is used and the variable is compared to six.text_type instead of six.string_types

On Python 2, six.text_type = unicode, this means that if an attribute of value passed in is str, then there will be an assertion error.

on Python 2:

  • six.string_types = (basestring,)
  • six.text_type = unicode

on Python 3:

  • six.string_types = (builtins.str, )
  • six.text_type = builtins.str

So I think the values should be compared against six.string_types and then six.text_type be used to coerce them for output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp