Commit 8f4eb006 authored by Wenzel Jakob's avatar Wenzel Jakob
Browse files

last breaking change: be consistent about the project name

parent 607654f7
/*
pybind/typeid.h: Convenience wrapper classes for basic Python types
pybind11/typeid.h: Convenience wrapper classes for basic Python types
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
......@@ -9,10 +9,10 @@
#pragma once
#include <pybind/common.h>
#include "common.h"
#include <utility>
NAMESPACE_BEGIN(pybind)
NAMESPACE_BEGIN(pybind11)
/* A few forward declarations */
class object;
......@@ -37,7 +37,7 @@ public:
inline detail::accessor operator[](const char *key);
inline detail::accessor attr(handle key);
inline detail::accessor attr(const char *key);
inline pybind::str str() const;
inline pybind11::str str() const;
template <typename T> T cast();
template <typename ... Args> object call(Args&&... args_);
operator bool() const { return m_ptr != nullptr; }
......@@ -230,13 +230,13 @@ private:
#endif
};
inline pybind::str handle::str() const {
inline pybind11::str handle::str() const {
PyObject *str = PyObject_Str(m_ptr);
#if PY_MAJOR_VERSION < 3
PyObject *unicode = PyUnicode_FromEncodedObject(str, "utf-8", nullptr);
Py_XDECREF(str); str = unicode;
#endif
return pybind::str(str, false);
return pybind11::str(str, false);
}
class bool_ : public object {
......@@ -370,12 +370,12 @@ inline internals &get_internals() {
if (internals_ptr)
return *internals_ptr;
handle builtins(PyEval_GetBuiltins());
capsule caps(builtins["__pybind__"]);
capsule caps(builtins["__pybind11__"]);
if (caps.check()) {
internals_ptr = caps;
} else {
internals_ptr = new internals();
builtins["__pybind__"] = capsule(internals_ptr);
builtins["__pybind11__"] = capsule(internals_ptr);
}
return *internals_ptr;
}
......@@ -413,4 +413,4 @@ inline handle get_type_handle(const std::type_info &tp) {
}
NAMESPACE_END(detail)
NAMESPACE_END(pybind)
NAMESPACE_END(pybind11)
/*
pybind/complex.h: Complex number support
pybind11/complex.h: Complex number support
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
......@@ -9,7 +9,7 @@
#pragma once
#include <pybind/pybind.h>
#include "pybind11.h"
#include <map>
#include <iostream>
......@@ -19,7 +19,7 @@
#pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
#endif
NAMESPACE_BEGIN(pybind)
NAMESPACE_BEGIN(pybind11)
NAMESPACE_BEGIN(detail)
template <typename Value> struct type_caster<std::vector<Value>> {
......@@ -104,7 +104,7 @@ NAMESPACE_END(detail)
inline std::ostream &operator<<(std::ostream &os, const object &obj) { os << (const char *) obj.str(); return os; }
NAMESPACE_END(pybind)
NAMESPACE_END(pybind11)
#if defined(_MSC_VER)
#pragma warning(pop)
......
/*
pybind/typeid.h: Compiler-independent access to type identifiers
pybind11/typeid.h: Compiler-independent access to type identifiers
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
......@@ -9,14 +9,13 @@
#pragma once
#include <pybind/typeid.h>
#include <cstdio>
#include <cstdlib>
#if defined(__GNUG__)
#include <cxxabi.h>
#endif
NAMESPACE_BEGIN(pybind)
NAMESPACE_BEGIN(pybind11)
NAMESPACE_BEGIN(detail)
/// Erase all occurrences of a substring
inline void erase_all(std::string &string, const std::string &search) {
......@@ -39,7 +38,7 @@ inline void clean_type_id(std::string &name) {
detail::erase_all(name, "struct ");
detail::erase_all(name, "enum ");
#endif
detail::erase_all(name, "pybind::");
detail::erase_all(name, "pybind11::");
}
NAMESPACE_END(detail)
......@@ -50,4 +49,4 @@ template <typename T> static std::string type_id() {
return name;
}
NAMESPACE_END(pybind)
NAMESPACE_END(pybind11)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment