GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python3.5.1: type().startswith() · Issue #71204 · python/cpython

Python3.5.1: type().startswith() #71204

New issue
Copy link
New issue
Copy link
Closed
Closed
Python3.5.1: type().startswith()#71204
Copy link
Labels
OS-windowstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

VertigoRay
mannequin
opened on May 14, 2016
Issue body actions
BPO 27017
Nosy @pfmoore, @tjguk, @stevendaprano, @zware, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-05-14.07:08:56.599>
created_at = <Date 2016-05-14.06:55:39.965>
labels = ['type-bug', 'invalid', 'OS-windows']
title = 'Python3.5.1: type().startswith()'
updated_at = <Date 2016-05-14.07:44:39.784>
user = 'https://bugs.python.org/VertigoRay'

bugs.python.org fields:

activity = <Date 2016-05-14.07:44:39.784>
actor = 'steven.daprano'
assignee = 'none'
closed = True
closed_date = <Date 2016-05-14.07:08:56.599>
closer = 'SilentGhost'
components = ['Windows']
creation = <Date 2016-05-14.06:55:39.965>
creator = 'VertigoRay'
dependencies = []
files = []
hgrepos = []
issue_num = 27017
keywords = []
message_count = 3.0
messages = ['265505', '265506', '265508']
nosy_count = 7.0
nosy_names = ['paul.moore', 'tim.golden', 'steven.daprano', 'SilentGhost', 'zach.ware', 'steve.dower', 'VertigoRay']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue27017'
versions = ['Python 3.5']

Activity

  1. VertigoRay commented on May 14, 2016

    @VertigoRay
    VertigoRaymannequin
    on May 14, 2016
    MannequinAuthor
    More actions

    This doesn't look like proper functionality

        Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
        Type "help", "copyright", "credits" or "license" for more information.
        >>> type('')
        <class 'str'>
        >>> type('').startswith('s')
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        TypeError: startswith() takes at least 1 argument (0 given)
        >>> type('').startswith('s', 's')
        True
  2. VertigoRay
    added
    OS-windows
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 14, 2016
  3. SilentGhost commented on May 14, 2016

    @SilentGhost
    SilentGhostmannequin
    on May 14, 2016
    Mannequin
    More actions

    This is exactly how methods on Python object have been behaving for year: any method can be called either as method on instance, or as method on class, with instance passed as the first argument.

  4. SilentGhost
    added
    invalid
    on May 14, 2016
  5. SilentGhost
    closed this as completedon May 14, 2016
  6. stevendaprano commented on May 14, 2016

    @stevendaprano
    stevendaprano
    on May 14, 2016
    Member
    More actions

    To explain in more detail: type('s').startswith is the same as str.startswith, which is an unbound method in Python 2 and a regular function in Python 3. Either way, it expects two arguments: a string which becomes "self", and a second string argument, which is the prefix being tested for.

    So type('any string').startswith('alphabet', 'al') is a long way of writing 'alphabet'.startswith('al').

  7. ezio-melotti
    transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.